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

docker-run is working, but docker-compose give errors "URL rejected: Malformed input to a URL function" #70

Closed
1 task done
ZhengYuan-Public opened this issue Feb 11, 2024 · 8 comments

Comments

@ZhengYuan-Public
Copy link

ZhengYuan-Public commented Feb 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I've managed to it working with docker run (I replaced my actual subdomains and token with XXXXXXXX),

$ root@docker:~/duckdns# cat docker_run.sh 
docker run -d \
  --name=duckdns \
  --net=host `#optional` \
  -e PUID=1000 `#optional` \
  -e PGID=1000 `#optional` \
  -e TZ=Asia/Shanghai `#optional` \
  -e SUBDOMAINS=XXXXXXXX \
  -e TOKEN=XXXXXXXX \
  -e UPDATE_IP=ipv4 `#optional` \
  -e LOG_FILE=false `#optional` \
  -v /path/to/duckdns/config:/config `#optional` \
  --restart unless-stopped \
  lscr.io/linuxserver/duckdns:latest

but somehow docker-compose is not working.

Expected Behavior

No response

Steps To Reproduce

I just used the template from the repo. (I replaced my actual subdomains and token with XXXXXXXX).

$ root@docker:~/duckdns# cat compose.yaml 
services:
  duckdns:
    image: lscr.io/linuxserver/duckdns:latest
    container_name: duckdns-compose
    network_mode: host #optional
    environment:
      - PUID=1000 #optional
      - PGID=1000 #optional
      - TZ=Asia/Shanghai #optional
      - SUBDOMAINS=XXXXXXXX
      - TOKEN=XXXXXXXX
      - UPDATE_IP=ipv4 #optional
      - LOG_FILE=true #optional
    volumes:
      - /path/to/duckdns/config:/config #optional
    restart: unless-stopped

After logging into the container, here are the env variables

$ root@docker:~/duckdns# docker exec -it duckdns-compose /bin/bash
$ root@docker:/# env
PUID=1000
HOSTNAME=docker
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
PWD=/
TZ=Asia/Shanghai
HOME=/root
PGID=1000
VIRTUAL_ENV=/lsiopy
LOG_FILE=true
S6_VERBOSITY=1
S6_STAGE2_HOOK=/docker-mods
SUBDOMAINS=XXXXXXXX
TOKEN=XXXXXXXX
TERM=xterm
UPDATE_IP=ipv4
SHLVL=1
PS1=$(whoami)@$(hostname):$(pwd)\$ 
LSIO_FIRST_PARTY=true
PATH=/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
_=/usr/bin/env

Environment

- OS: Proxmox VE 8.1.4
- How docker service was installed: Docker LXC via [Proxmox VE Helper-Scripts](https://tteck.github.io/Proxmox/)

CPU architecture

x86-64

Docker creation

docker compose up -d

Container logs

$ root@docker:~/duckdns# docker logs duckdns-compose
[migrations] started
[migrations] no migrations found
───────────────────────────────────────

      ██╗     ███████╗██╗ ██████╗
      ██║     ██╔════╝██║██╔═══██╗
      ██║     ███████╗██║██║   ██║
      ██║     ╚════██║██║██║   ██║
      ███████╗███████║██║╚██████╔╝
      ╚══════╝╚══════╝╚═╝ ╚═════╝

   Brought to you by linuxserver.io
───────────────────────────────────────

To support the app dev(s) visit:
DuckDNS: https://www.patreon.com/user?u=3209735

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────

warning: state file /config/logrotate.status is world-readable and thus can be locked from other unprivileged users. Skipping lock acquisition...
Detecting IPv4 via CloudFlare
curl: (3) URL rejected: Malformed input to a URL function
Something went wrong, please check your settings Mon Feb 12 01:30:02 CST 2024
The response returned was:

[custom-init] No custom files found, skipping...
[ls.io-init] done.
Copy link

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@ZhengYuan-Public ZhengYuan-Public changed the title docker-compose is not getting subdomain and token as env variables docker-run is working, but docker-compose give errors "URL rejected: Malformed input to a URL function" Feb 11, 2024
@Roxedus
Copy link
Member

Roxedus commented Feb 11, 2024

env is not a valid test. environment variables are sandboxed. cat /run/s6/container_environment/SUBDOMAINS is

@ZhengYuan-Public
Copy link
Author

env is not a valid test. environment variables are sandboxed. cat /run/s6/container_environment/SUBDOMAINS is

Hi, thanks for your reply. I've checked both the SUMDOMAINS and TOKEN in the folder /run/s6/container_environment, and they are all properly assigned.

I've tried to find the problem myself and I was able to pinpoint it to this line of code.

In the docker compose container:

$ root@docker:/# dig +short ch txt whoami.cloudflare -4 @1.1.1.1 | sed 's/"//g'
;; communications error to 1.1.1.1#53: timed out

While in the docker run container:

$ root@docker:/# dig +short ch txt whoami.cloudflare -4 @1.1.1.1 | sed 's/"//g'
XXX.XXX.XXX.XXX

But it's weird that their network settings are exactly the same (--net=host for docker run and network_mode: host for docker compose)

@Biorix
Copy link

Biorix commented Sep 3, 2024

Can you clarify how you solved the issue? I'm facing the same issue and have not been able to fix it

Thanks

@ZhengYuan-Public
Copy link
Author

Can you clarify how you solved the issue? I'm facing the same issue and have not been able to fix it

Thanks

Hi, I had the issue when I was using docker which came with QNAP NAS and it was caused by a setting named advanced folder permission. I didn't change anything and it works well on other docker installations.

@Biorix
Copy link

Biorix commented Sep 3, 2024

OK thank you
I do have the same issue with docker-compose and not with the run command.
You managed to make it work with compose?

@eric10k93
Copy link

I'm getting this error as well on a brand new install with docker compose on ubuntu server... I'm not so sure this should have been closed...

@alx-xlx
Copy link

alx-xlx commented Oct 2, 2024

I am getting similar issue on pi4b

DuckDNS request at Fri Sep 27 13:07:16 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:11:20 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
curl: (6) Could not resolve host: www.duckdns.org
Something went wrong, please check your settings Fri Sep 27 13:18:49 IST 2024
The response returned was:


Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:22:10 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:26:18 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
curl: (3) URL rejected: Malformed input to a URL function
Something went wrong, please check your settings Fri Sep 27 13:32:34 IST 2024
The response returned was:


Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:37:12 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:43:34 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:47:44 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:53:33 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 13:56:09 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 14:01:21 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 14:09:22 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
Something went wrong, please check your settings Fri Sep 27 14:11:09 IST 2024
The response returned was:
<html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 14:19:03 IST 2024 successful. IP(s) unchanged.
Detecting IPv4 via CloudFlare
DuckDNS request at Fri Sep 27 14:23:18 IST 2024 successful. IP(s) unchanged.

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

No branches or pull requests

5 participants