-
Notifications
You must be signed in to change notification settings - Fork 199
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
404 for some sizes at particular time - Docker #206
Comments
If you see such errors:
Within the weserv module error log ( # Global nginx / libvips errors
docker exec imagesweserv tail /var/log/nginx/error.log
# weserv module errors
docker exec imagesweserv tail /var/log/nginx/weserv-local-error.log
# rate limiting errors
docker exec imagesweserv tail /var/log/nginx/weserv-error.log If looking up of IPv6 addresses is not desired, the --- a/ngx_conf/imagesweserv.conf
+++ b/ngx_conf/imagesweserv.conf
@@ -54,7 +54,7 @@ server {
weserv on;
location / {
- resolver 8.8.8.8; # Use Google's open DNS server
+ resolver 8.8.8.8 ipv6=off; # Use Google's open DNS server
weserv_mode proxy; # Default
}
|
@amitjoseph Were you able to make any progress with this? |
@amitjoseph I'm also curious if you discovered the root cause, or need any help debugging this issue, please let us know by re-opening the issue if so! |
We had the same issue and your suggestion @kleisauke fixed it for us! Thanks! |
@andrieslouw We just tried this fix but are still getting the IP assignment errors -- seems like the
imagesweserv.conf modifications look like this:
Is there something else we can adjust or dig into to find the source of these errors? It looks like the IPV6 address upstream that fails is a cloudfair address. |
Is this possibly related? https://trac.nginx.org/nginx/ticket/723 |
If the bug is in NGINX's proxy_pass: A really ugly hack would be to remove the IPv6 addr corresponding to the If the bug is in resolving and connecting to IPv6-origins, a ugly solution would be to use a DNS-resolver that doesn't provide AAAA-records, or strips them from all responses. But I'm more concerned by the lack of IPv6-support in your setup, is there no other way to fix that? We see more and more hosts having IPv6-only support, and/or really broken and CGNAT-ed IPv4. IPv6 is the way of the future, and the preferred way of connecting networks nowadays. The only right way to solve this is to get IPv6 working in your stack 😉 |
@andrieslouw The weird thing is it works some of the time. I'll look into using a different hostname and report back. AFAIK IPV6 should be enabled in the stack.
|
@andrieslouw I'm not a networking expert, but it looks like IPV6 is enabled. There does not appear to be a
|
Oh no. This could be the issue: https://docs.digitalocean.com/products/networking/ipv6/#:~:text=Load%20balancers%2C%20Floating%20IPs%2C%20and,to%20(like%20a%20Droplet). Not supported for load balancers. Will test connecting directly to the server. |
Update, load balancer should not be the issue. @andrieslouw Interestingly enough. I can
|
@andrieslouw OK. That was the issue. Docker networking itself was not configured for IPV6. (Seems this is not the default for docker for some reason? Possibly a botched install?) Either way --- For the time being I have run the docker container using |
Please let us know if there is something specific missing in our proposed docker config. Glad you got IPv6 working, hope we can help other users with your findings. Thank you for taking us with you while debugging this, it's really helpful to get some insight! @kleisauke: Could you take a look into the IPv6 stack that Docker is using by default? Is something missing at our side? |
@andrieslouw I will do my best. Thanks for your assistance with this. I likely would not have figured out IPV6 was not working for a LONG time. I do wonder if it has to do with the order that the system configuration happens in. E.g. if IPV6 is configured after docker packages are installed, I'm wondering if it needs to be re-packaged/installed to pick that up. I need to do more digging to see if docker is even supposed to work with IPV6 out of the box. |
For anyone experiencing this issue with Docker, I recommend running this within the container: $ cat /etc/resolv.conf | grep nameserver If the output displays --- a/etc/nginx/imagesweserv.conf
+++ b/etc/nginx/imagesweserv.conf
@@ -68,7 +68,7 @@ server {
deny all;
location / {
- resolver 8.8.8.8; # Use Google's open DNS server
+ resolver 127.0.0.11; # Use Docker's embedded DNS server
weserv proxy;
add_header X-Upstream-Response-Length $weserv_response_length; (see also: https://stackoverflow.com/a/37656784) |
I have observed this strange problem, some sizes I'm getting a 404 for some sizes at a particular time.
I'm using the default configuration. I'm not able point out where actually this problem is occurring.
Error Message:
Suppose
http://localhost:81/?url=https://images.unsplash.com/photo-1554204428-01ab5f412a28&w=750
gives me this error but
http://localhost:81/?url=https://images.unsplash.com/photo-1554204428-01ab5f412a28&w=700
works fineThis is what I don't understand.
Docker log:
The text was updated successfully, but these errors were encountered: