[GH-ISSUE #1015] invalid IPv6 address in resolver, scoped address, zone index #854

Open
opened 2026-02-26 06:34:41 +03:00 by kerem · 4 comments
Owner

Originally created by @JonasVgt on GitHub (Apr 13, 2021).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1015

I have made a Comment on a different Bug Report #149 but noticed later, that my problem was different to the one described there. That is why I made this separate Bug report.

The Problem

I am running this Docker Image on my Rapsberry Pi Home server. When I try to start the Container, it is marked as 'unhealthy', the web-interface will not start and the following error is repeatedly being logged:

nginx: [emerg] invalid IPv6 address in resolver "[fe80::abd:43ff:feca:7350%2]" in /etc/nginx/conf.d/include/resolvers.conf:1
finish: applet not found

Cause

When the Container is beeing started it will copy /etc/resolv.conf from the host machine (outside of the container) into the Container to the same location. The Content of that file will then be converted by the script located at nginx-proxy-manager/docker/rootfs/etc/services.d/nginx/run of this repository in the following line:

# Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]`
# thanks @tfmm
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf

The output will then be written into /etc/nginx/conf.d/include/resolvers.conf. This file is read by nginx which will throw the error.

/etc/resolv.conf:

nameserver 8.8.8.8
nameserver fd00::3a10:d5ff:fe77:c05d
nameserver fe80::abd:43ff:feca:7350%2
search jonas.local

/etc/nginx/conf.d/include/resolvers.conf:
resolver 127.0.0.11 [fd00::3a10:d5ff:fe77:c05d] [fe80::abd:43ff:feca:7350%2] ;

Note: fd00::3a10:d5ff:fe77:c05d is the IP of the Router which is connected to the Internet and directly to my Server via ethernet. fe80::abd:43ff:feca:7350 is the IP of a second Router which is only responsible for the WLAN in my Network

The Error emerges, because one of the IPs is ending with the zone index %2.

How to reproduce

Unfortunately I don't have any knowledge in this area and can't give an explanation on how to reproduce this behavior other than adding the IP address with zone index manually to the resolver of the host-machine.
As stated before I have two Routers in my Network which might be the root cause of the Problem.

The Fix

A simple fix would be to edit the line which converts /etc/resolv.conf to /etc/nginx/conf.d/include/resolvers.conf so, that it will remove the zone index or the entire scoped IP. Unfortunately I am unable to find if nginx should handle these scoped IPs or if these IPs should even exist in /etc/resolv.conf. So this may fix a behavior which shouldn't even exist.

Setup

Device: Raspberry Pi 4B
Operating System: Raspbian GNU/Linux 10 (buster)
Docker:

Client: Docker Engine - Community
 Version:           20.10.5
 API version:       1.41
 Go version:        go1.13.15
 Git commit:        55c4c88
 Built:             Tue Mar  2 20:19:30 2021
 OS/Arch:           linux/arm
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.5
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.13.15
  Git commit:       363e9a8
  Built:            Tue Mar  2 20:17:16 2021
  OS/Arch:          linux/arm
  Experimental:     false
 containerd:
  Version:          1.4.4
  GitCommit:        05f951a3781f4f2c1911b05e61c160e9c30eaa8e
 runc:
  Version:          1.0.0-rc93
  GitCommit:        12644e614e25b05da6fd08a38ffa0cfe1903fdec
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Container: jc21/nginx-proxy-manager:latest

Thank you for the Help!

Originally created by @JonasVgt on GitHub (Apr 13, 2021). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/1015 I have made a Comment on a different Bug Report #149 but noticed later, that my problem was different to the one described there. That is why I made this separate Bug report. ### The Problem I am running this Docker Image on my Rapsberry Pi Home server. When I try to start the Container, it is marked as 'unhealthy', the web-interface will not start and the following error is repeatedly being logged: ``` nginx: [emerg] invalid IPv6 address in resolver "[fe80::abd:43ff:feca:7350%2]" in /etc/nginx/conf.d/include/resolvers.conf:1 finish: applet not found ``` ### Cause When the Container is beeing started it will copy `/etc/resolv.conf` from the host machine (outside of the container) into the Container to the same location. The Content of that file will then be converted by the script located at ` nginx-proxy-manager/docker/rootfs/etc/services.d/nginx/run` of this repository in the following line: ``` # Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]` # thanks @tfmm echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf ``` The output will then be written into `/etc/nginx/conf.d/include/resolvers.conf`. This file is read by nginx which will throw the error. /etc/resolv.conf: ``` nameserver 8.8.8.8 nameserver fd00::3a10:d5ff:fe77:c05d nameserver fe80::abd:43ff:feca:7350%2 search jonas.local ``` /etc/nginx/conf.d/include/resolvers.conf: `resolver 127.0.0.11 [fd00::3a10:d5ff:fe77:c05d] [fe80::abd:43ff:feca:7350%2] ;` _Note: `fd00::3a10:d5ff:fe77:c05d` is the IP of the Router which is connected to the Internet and directly to my Server via ethernet. `fe80::abd:43ff:feca:7350` is the IP of a second Router which is only responsible for the WLAN in my Network_ The Error emerges, because one of the IPs is ending with the [ zone index](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses_(with_zone_index)) `%2`. ### How to reproduce Unfortunately I don't have any knowledge in this area and can't give an explanation on how to reproduce this behavior other than adding the IP address with zone index manually to the resolver of the host-machine. As stated before I have two Routers in my Network which might be the root cause of the Problem. ### The Fix A simple fix would be to edit the line which converts `/etc/resolv.conf` to `/etc/nginx/conf.d/include/resolvers.conf` so, that it will remove the zone index or the entire scoped IP. Unfortunately I am unable to find if nginx should handle these scoped IPs or if these IPs should even exist in `/etc/resolv.conf`. So this may fix a behavior which shouldn't even exist. ### Setup Device: Raspberry Pi 4B Operating System: Raspbian GNU/Linux 10 (buster) Docker: ``` Client: Docker Engine - Community Version: 20.10.5 API version: 1.41 Go version: go1.13.15 Git commit: 55c4c88 Built: Tue Mar 2 20:19:30 2021 OS/Arch: linux/arm Context: default Experimental: true Server: Docker Engine - Community Engine: Version: 20.10.5 API version: 1.41 (minimum version 1.12) Go version: go1.13.15 Git commit: 363e9a8 Built: Tue Mar 2 20:17:16 2021 OS/Arch: linux/arm Experimental: false containerd: Version: 1.4.4 GitCommit: 05f951a3781f4f2c1911b05e61c160e9c30eaa8e runc: Version: 1.0.0-rc93 GitCommit: 12644e614e25b05da6fd08a38ffa0cfe1903fdec docker-init: Version: 0.19.0 GitCommit: de40ad0 ``` Container: jc21/nginx-proxy-manager:latest Thank you for the Help!
Author
Owner

@jc21 commented on GitHub (Apr 13, 2021):

Thanks for the detailed report. I don't see why we can't include that second address in the resolvers. Shouldn't be too hard to fix the regex.

<!-- gh-comment-id:818662685 --> @jc21 commented on GitHub (Apr 13, 2021): Thanks for the detailed report. I don't see why we can't include that second address in the resolvers. Shouldn't be too hard to fix the regex.
Author
Owner

@github-actions[bot] commented on GitHub (Mar 13, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:1993072806 --> @github-actions[bot] commented on GitHub (Mar 13, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@xbingW commented on GitHub (Jul 9, 2024):

same error

nginx: [emerg] invalid IPv6 address in resolver "[fe80::46d9:e7ff:fe95:e3db%br0]" in /etc/nginx/nginx.conf:13

<!-- gh-comment-id:2216386958 --> @xbingW commented on GitHub (Jul 9, 2024): same error nginx: [emerg] invalid IPv6 address in resolver "[fe80::46d9:e7ff:fe95:e3db%br0]" in /etc/nginx/nginx.conf:13
Author
Owner

@github-actions[bot] commented on GitHub (Apr 25, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2829221174 --> @github-actions[bot] commented on GitHub (Apr 25, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#854
No description provided.