Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] nginx container starts but no tcp ports exposed #164

Closed
spupuz opened this issue May 16, 2022 · 14 comments
Closed

[BUG] nginx container starts but no tcp ports exposed #164

spupuz opened this issue May 16, 2022 · 14 comments

Comments

@spupuz
Copy link

spupuz commented May 16, 2022

Hello eveybody

can't access port 2283 or 2284

l: (7) Failed to connect to 192.168.1.xxx port 2283 after 0 ms: Connection refused

on portainer nginx container starts but no tcp port exposed

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error
@spupuz spupuz added the bug label May 16, 2022
@alextran1502
Copy link
Contributor

I am not sure how you set up your Portainer network to help you troubleshoot. Can you take some screenshots?

@spupuz
Copy link
Author

spupuz commented May 17, 2022

i tried also from docker-compse command from command line with same result

@alextran1502
Copy link
Contributor

After you start the docker-compose command, can you run docker ps and show the result?

@spupuz
Copy link
Author

spupuz commented May 17, 2022

here is the output:

docker ps
CONTAINER ID   IMAGE                                            COMMAND                  CREATED              STATUS                 PORTS                                                                                                                                                                                            NAMES
e2655d8593c1   nginx:latest                                     "/docker-entrypoint.…"   About a minute ago   Up About a minute      0.0.0.0:2283->80/tcp, :::2283->80/tcp, 0.0.0.0:2284->443/tcp, :::2284->443/tcp                                                                                                                   proxy_nginx
63a3ba505a2c   altran1502/immich-microservices:latest           "/bin/sh ./entrypoin…"   About a minute ago   Up About a minute      3001/tcp                                                                                                                                                                                         immich-compose_immich-microservices_1
35c0627ad210   altran1502/immich-server:latest                  "/bin/sh ./entrypoin…"   About a minute ago   Up About a minute      3000/tcp                                                                                                                                                                                         immich-compose_immich-server_1
6b4015236870   redis:6.2                                        "docker-entrypoint.s…"   About a minute ago   Up About a minute      6379/tcp                                                                                                                                                                                         immich_redis
2101e411d621   postgres:14                                      "docker-entrypoint.s…"   About a minute ago   Up About a minute      0.0.0.0:5432->5432/tcp, :::5432->5432/tcp                                                                                                                                                        immich_postgres

@alextran1502
Copy link
Contributor

This looks identical to my output as well.

From another machine, if you try to ping your server, does it get through? And what is the output when you try to do curl http://192.168.1.xxx:2283/server-info/ping

Did you perform the docker-compose command on a different VM/machine or on the same VM/machine that runs Portainer?

@spupuz
Copy link
Author

spupuz commented May 17, 2022

curl http://192.168.1.xxx:2283/server-info/ping
curl: (7) Failed to connect to 192.168.1.112 port 2283 after 0 ms: Connection refused

@spupuz
Copy link
Author

spupuz commented May 17, 2022

all other container i have the tcp port are working wihtout any problem also the postgres

@alextran1502
Copy link
Contributor

alextran1502 commented May 17, 2022

So you are running this on the same VM that runs Portainer, correct?

Can you change the binding port of nginx service in docker-compose.yml to a different port and see if it makes a difference?

Maybe 12283 and 12284

  nginx:
    container_name: proxy_nginx
    image: nginx:latest
    volumes:
      - ./settings/nginx-conf:/etc/nginx/conf.d
    ports:
      - 2283:80
      - 2284:443
    [...]

@spupuz
Copy link
Author

spupuz commented May 17, 2022

curl http://192.168.1.112:12283/server-info/ping
curl: (7) Failed to connect to 192.168.1.112 port 12283 after 9 ms: Connection refused

image

@spupuz
Copy link
Author

spupuz commented May 17, 2022

seems to be something related to nginx proxy not working this container also has no log working

~ docker logs proxy_nginx
Error response from daemon: configured logging driver does not support reading
other logs works

~ docker logs immich_immich-server_1

> [email protected] prebuild
> rimraf dist


> [email protected] build
> nest build


> [email protected] start:prod
> node dist/main

[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [NestFactory] Starting Nest application...
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] AppModule dependencies initialized +104ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] JwtModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] ConfigHostModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] DiscoveryModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] ConfigModule dependencies initialized +9ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BullModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] ServerInfoModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmCoreModule dependencies initialized +370ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] TypeOrmModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] CommunicationModule dependencies initialized +2ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] ImmichJwtModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] BackgroundTaskModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] ImageOptimizeModule dependencies initialized +2ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] UserModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] DeviceInfoModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] SharingModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] AuthModule dependencies initialized +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [InstanceLoader] AssetModule dependencies initialized +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RoutesResolver] UserController {/user}: +12ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/user, GET} route +3ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RoutesResolver] AssetController {/asset}: +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/upload, POST} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/download, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/file, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/thumbnail/:assetId, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/allObjects, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/allLocation, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/searchTerm, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/search, POST} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/:deviceId, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset/assetById/:assetId, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/asset, DELETE} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RoutesResolver] AuthController {/auth}: +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/auth/login, POST} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/auth/signUp, POST} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/auth/validateToken, POST} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RoutesResolver] DeviceInfoController {/device-info}: +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/device-info, POST} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/device-info, PATCH} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RoutesResolver] ServerInfoController {/server-info}: +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/server-info, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/server-info/ping, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/server-info/mapbox, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/server-info/version, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RoutesResolver] SharingController {/shared}: +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/createAlbum, POST} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/addUsers, POST} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/addAssets, POST} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/allSharedAlbums, GET} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/:albumId, GET} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/removeAssets, DELETE} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/:albumId, DELETE} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/leaveAlbum/:albumId, DELETE} route +1ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [RouterExplorer] Mapped {/shared/updateInfo, PATCH} route +0ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [NestApplication] Nest application successfully started +8ms
[Nest] 51  - 05/17/2022, 10:21:59 AM     LOG [IMMICH SERVER] Running Immich Server in PRODUCTION environment
openmediavault root
12:26:03 Tue May 17
~ 

@alextran1502
Copy link
Contributor

You can comment out the

    logging:
      driver: none

in nginx service to see log, it is quite chatty so I disable it for cleaning logs

@spupuz
Copy link
Author

spupuz commented May 17, 2022

this is the nginx log:

/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration /docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/ /docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh 10-listen-on-ipv6-by-default.sh: info: /etc/nginx/conf.d/default.conf is not a file or does not exist /docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh /docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh /docker-entrypoint.sh: Configuration complete; ready for start up 2022/05/17 10:30:57 [notice] 1#1: using the "epoll" event method 2022/05/17 10:30:57 [notice] 1#1: nginx/1.21.6 2022/05/17 10:30:57 [notice] 1#1: built by gcc 10.2.1 20210110 (Debian 10.2.1-6) 2022/05/17 10:30:57 [notice] 1#1: OS: Linux 5.15.35-1-pve 2022/05/17 10:30:57 [notice] 1#1: getrlimit(RLIMIT_NOFILE): 1048576:1048576 2022/05/17 10:30:57 [notice] 1#1: start worker processes 2022/05/17 10:30:57 [notice] 1#1: start worker process 22 2022/05/17 10:30:57 [notice] 1#1: start worker process 23 2022/05/17 10:30:57 [notice] 1#1: start worker process 24 2022/05/17 10:30:57 [notice] 1#1: start worker process 25 2022/05/17 10:30:57 [notice] 1#1: start worker process 26 2022/05/17 10:30:57 [notice] 1#1: start worker process 27 2022/05/17 10:30:57 [notice] 1#1: start worker process 28 2022/05/17 10:30:57 [notice] 1#1: start worker process 29

@alextran1502
Copy link
Contributor

AH I see, it is looking for the nginx.conf file in the nginx service. You can see the file in the repository at docker/settings/nginx-conf/nginx.conf So you have to find a place on your machine to place this file and mount or point your Portainer Stack configuration to it, so docker-compose can find the file it is looking for.

@spupuz
Copy link
Author

spupuz commented May 17, 2022

ok now it's working.

@spupuz spupuz closed this as completed May 17, 2022
@spupuz spupuz changed the title [BUG] nginx container starts but no tcp ports expose [BUG] nginx container starts but no tcp ports exposed May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants