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

Harbor nginx container fail to start when install with docker-compose #19932

Closed
stonezdj opened this issue Feb 1, 2024 · 3 comments
Closed

Comments

@stonezdj
Copy link
Contributor

stonezdj commented Feb 1, 2024

The nginx container log:

nginx: [emerg] socket() [::]:8443 failed (97: Address family not supported by protocol)

After update the common/config/nginx

  server {
    listen 8443 ssl;
    listen [::]:8443 ssl;
#    server_name harbordomain.com;
    server_tokens off;

to remove the line listen [::]:8443 ssl;, then the nginx container can start.

Root cause: When IPv6 is disabled, the [::]:8443 will be considered a invalid address and failed to start nginx.

@MinerYang
Copy link
Contributor

workaround

  • step1 stop harbor containers
sudo docker compose down -v
  • step2 edit the/common/config/nginx/nginx.conf file, if internal_tls is enabled please also edit/common/config/portal/nginx.conf as well
## remove this line 
listen [::]:8443 ssl; 

## save file
  • step3 restart harbor
sudo docker compose up -d

@MinerYang
Copy link
Contributor

MinerYang commented Feb 5, 2024

to keep consistent of our upgrade path, e.g. from 2.9.3 (if with ip_family config) and migrate to 2.10.0(without ip_family_config), we will only add this new ip_family configuration since v2.11 and do following reverse:

With all these changes, in case of you review this issue/prs with confusion, you should be aware of

  • users could use ip_family config only since v2.11+
  • users would like to use listen [::]:8443 ssl config in nginx related components below v2.11 should add this manually.
  • users use v2.9.2 and migrate to 2.10.x need to add this listen [::]:8443 ssl manually if ipv6 address port is necessary in your network stack.

@stonezdj
Copy link
Contributor Author

All prs merged, close it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants