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

Environment Setup: docker_nginx doesn't not start - [emerg] 1#1: host not found in upstream #249

Open
maxiar opened this issue Nov 19, 2020 · 2 comments

Comments

@maxiar
Copy link

maxiar commented Nov 19, 2020

Hi! I'm trying to startup the projects using the latest version of vscode, dockers over windows 10...
I following the next steps successfully withouts errors but the

  1. Change the sql sa password
  2. Compile all projects successfully
  3. Then I edit my system32/drivers/etc/hosts file and add the 127.0.0.1 wallet.local
  4. Run the truscert-windows.ps1 to add the localhost certificate
  5. Run docker-compose build & docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d

Do I forgot any steps?

All was fine but the the next containers don't start:
image

docker_nginx logs:

/docker-entrypoint.sh: Configuration complete; ready for start up
2020/11/19 02:28:54 [emerg] 1#1: host not found in upstream "accounts-api" in /etc/nginx/nginx.conf:41
nginx: [emerg] host not found in upstream "accounts-api" in /etc/nginx/nginx.conf:41

Obviously I can't browser any https://wallet.local:8081/ website....
I attached the nginx_config.json configuration file
docker_nginx.log

accounts logs:
standard_init_linux.go:211: exec user process caused "no such file or directory"

docker_accounts-api-seeds logs

Build started...
Build succeeded.
Server=sql1;User Id=sa;Password=XXXX;Database=Accounts;
Applying migration '20200821064304_InitialCreate'.
Done.

NOTE: I verified the SQL connections and tables, all works fine.

I supossed that the main issue is the nginx but I don't know how to fix it!

PD: I install and uninstall some times the dockers images and delete all containers and start again, without success.

Thanks

@ivanpaulovich
Copy link
Owner

Hey @maxiar,

Thank you reaching us!

I suspect the issue is on accounts-api. It did not find the required /https/localhost.crt file.

cp /https/localhost.crt /usr/local/share/ca-certificates/localhost.crt

Please check the "shared drivers" in Docker desktop or run docker inspect accounts-api and look for

"Mounts": [
            {
                "Type": "bind",
                "Source": "C:\\repos\\clean-architecture-manga\\.docker\\https",
                "Destination": "/https",
                "Mode": "ro",
                "RW": false,
                "Propagation": "rprivate"
            }
        ]

To narrow your findings try docker-compose -f docker-compose.yml -f docker-compose.override.yml up -d accounts-api

@maxiar
Copy link
Author

maxiar commented Nov 19, 2020

Hi! I don't have the "shared drivers" in Docker desktop, this option is only enabled for Windows Containers (docker/for-win#7199 (comment)).
I'm running in a Linux Containers with WSL2 activated:
https://docs.docker.com/docker-for-windows/wsl/
image

I verified the "docker inspect accounts-api" I found this:

    "Mounts": [
        {
            "Type": "bind",
            "Source": **"C:\\Projects\\Personal\\clean-architecture-manga\\.docker\\https",**
            "Destination": "/https",
            "Mode": "ro",
            "RW": false,
            "Propagation": "rprivate"
        }
    ],

And the files are located correctly:
image

Note that: In the previous post I tell you that only run the "Run the truscert-windows.ps1 to add the localhost certificate", may be I missing something...

How to test or execute this command into accounts-api?
cp /https/localhost.crt /usr/local/share/ca-certificates/localhost.crt

charithdesilva pushed a commit to charithdesilva/clean-architecture-manga that referenced this issue Mar 10, 2021
ivanpaulovich pushed a commit that referenced this issue Mar 15, 2021
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