Error GoDaddy DNS

1. The problem I’m having:

This is my Caddyfile:

{
	admin 0.0.0.0:2020
}

sceptic.au {
    tls {
        dns godaddy API_Token
    }
   
    reverse_proxy localhost:443
}

https://nc.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:11000
}

https://sonarr.sceptic.au:443 {
	# Configuration for site1
	tls internal
	reverse_proxy localhost:8989
}

https://homepage.sceptic.au:443 {
	# Configuration for site2
	tls internal
	reverse_proxy localhost:3000
}

https://overseerr.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:5055
}

https://maintainerr.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8154
}

https://radarr.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:7878
}

https://readarr.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8787
}

https://lidarr.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8686
}

https://sabnzbd.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8089
}

https://prowlarr.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:9696
}

https://audio.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:13378
}

https://tautulli.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8181
}

https://paperless.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8003
}

https://actual.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:5006
}

https://freshrss.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8282
}

https://immich.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:2283
}

https://dozzle.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8888
}

https://ukuma.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:3001
}

https://filebrowser.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8383
}

https://dockge.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:5001
}

https://linkding.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:9090
}

https://change.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:5000
}

https://duplicati.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8200
}

https://stirlingpdf.sceptic.au:443 {
	tls internal
	reverse_proxy localhost:8088
}

I have zero knowledge about this stuff, learning as I go.

I’m trying to add a TLS certificate to my domain to use locally. The certificate that is being used by caddy requires a refresh every so often, and to ignore the unsafe certificate warning when I have all the subdomains open in the browser. I want that to stop, if that’s possible.

My domain sceptic.au was purchased from GoDaddy and I installed xcaddy and followed the instructions here: https://caddyserver.com/docs/build#xcaddy

I then ran this command:

xcaddy build --with github.com/caddy-dns/godaddy

I then ran this command to reload caddy:

caddy reload --config /etc/caddy/Caddyfile

2. Error messages and/or full log output:

user@host:~$ caddy reload --config /etc/caddy/Caddyfile
2024/01/31 05:44:58.588	INFO	using provided configuration	{"config_file": "/etc/caddy/Caddyfile", "config_adapter": ""}
Error: adapting config using caddyfile: parsing caddyfile tokens for 'tls': getting module named 'dns.providers.godaddy': module not registered: dns.providers.godaddy, at /etc/caddy/Caddyfile:16

3. Caddy version:

v2.7.6 h1:w0NymbG2m9PcvKWsrXO6EEkY9Ru4FJK8uQbYcev1p3A=

4. How I installed and ran Caddy:

I don’t know the terminology, but I installed it directly to my Ubuntu 23.10.1 Computer and not using docker.

a. System environment:

Ubuntu 23.10.1

b. Command:

c. Service/unit/compose file:

d. My complete Caddy config:

PASTE OVER THIS, BETWEEN THE ``` LINES.
Please use the preview pane to ensure it looks nice.

5. Links to relevant resources:

After making the build, you need to move the build binary to replace the existing one. Then you have to restart Caddy, (not reload) to make it use the new process. A reload is an in-process config reload, it doesn’t use the new process.

Follow these instructions to set up a diversion with your custom build: Build from source — Caddy Documentation

1 Like

I followed the instruction but received this error:

user@host:~$ sudo systemctl restart caddy
Job for caddy.service failed because the control process exited with error code.
See "systemctl status caddy.service" and "journalctl -xeu caddy.service" for details.
skepticalme@PlexServer:~$ systemctl status caddy.service
× caddy.service - Caddy
     Loaded: loaded (/lib/systemd/system/caddy.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Wed 2024-01-31 17:23:43 AEDT; 20s ago
   Duration: 1d 5h 44min 24.067s
       Docs: https://caddyserver.com/docs/
    Process: 2654960 ExecStart=/usr/bin/caddy run --environ --config /etc/caddy/Caddyfile (code=exited, status=203/EXEC)
   Main PID: 2654960 (code=exited, status=203/EXEC)
        CPU: 30ms

Jan 31 17:23:43 PlexServer systemd[1]: Starting caddy.service - Caddy...
Jan 31 17:23:43 PlexServer (caddy)[2654960]: caddy.service: Failed to locate executable /usr/bin/caddy: Is a directory
Jan 31 17:23:43 PlexServer (caddy)[2654960]: caddy.service: Failed at step EXEC spawning /usr/bin/caddy: Is a directory
Jan 31 17:23:43 PlexServer systemd[1]: caddy.service: Main process exited, code=exited, status=203/EXEC
Jan 31 17:23:43 PlexServer systemd[1]: caddy.service: Failed with result 'exit-code'.
Jan 31 17:23:43 PlexServer systemd[1]: Failed to start caddy.service - Caddy.

You must have done something wrong, that shouldn’t be a directory, it should be a file.

1 Like

I’m not quite sure what I did, did I install go in that directory that is supposed to be a file? I really don’t understand how I did.

skepticalme@PlexServer:/usr/bin/caddy$ ls
admin.go           listen.go
admin_test.go      listen_unix.go
AUTHORS            listen_unix_setopt_freebsd.go
caddy              listen_unix_setopt.go
caddyconfig        logging.go
caddy.go           metrics.go
caddytest          modules
caddy_test.go      modules.go
cmd                modules_test.go
context.go         notify
context_test.go    README.md
duration_fuzz.go   replacer_fuzz.go
filesystem.go      replacer.go
go.mod             replacer_test.go
go.sum             service_windows.go
internal           sigtrap.go
LICENSE            sigtrap_nonposix.go
listeners_fuzz.go  sigtrap_posix.go
listeners.go       storage.go
listeners_test.go  usagepool.go

I couldn’t restart caddy, so I did this to get it going for now (I also edited the Caddyfile to remove the domain). Thank you for your help, I really want to solve this:

skepticalme@PlexServer:~$ sudo update-alternatives --config caddy
There are 2 choices for the alternative caddy (providing /usr/bin/caddy).

  Selection    Path                    Priority   Status
------------------------------------------------------------
* 0            /usr/bin/caddy.custom    50        auto mode
  1            /usr/bin/caddy.custom    50        manual mode
  2            /usr/bin/caddy.default   10        manual mode

Press <enter> to keep the current choice[*], or type selection number: 2
update-alternatives: using /usr/bin/caddy.default to provide /usr/bin/caddy (caddy) in manual mode
skepticalme@PlexServer:~$ sudo systemctl restart caddyskepticalme@PlexServer:~$ 

What?!? That looks like you checked out the Caddy source in that location. That’s totally wrong.

Please show the commands you ran to get to that point.

Run rm -rf /usr/bin/caddy to wipe that out.

The Caddy program is supposed to be a single file called caddy and placed in /usr/bin. When you run xcaddy build, it produces that program in your current directory. You’re meant to move it afterwards to the right place for your system.

1 Like

I installed xcaddy while in /home. As well as xcaddy build.

Then I ran the following commands:

sudo dpkg-divert --divert /usr/bin/caddy.default --rename /usr/bin/caddy
sudo mv ./caddy /usr/bin/caddy.custom
sudo update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.default 10
sudo update-alternatives --install /usr/bin/caddy caddy /usr/bin/caddy.custom 50
sudo systemctl restart caddy

I got those commands from here.

Ok, I’ll delete that directory and wait for a response.

This is what is in /home, the file caddy is there:

skepticalme@PlexServer:~$ ls
ls: cannot access 'S3DriveMount': Transport endpoint is not connected
caddy      go             Pictures      Templates
Desktop    immich-app     Public        Videos
Documents  Music          S3DriveMount
Downloads  paperless-ngx  snap

That doesn’t explain why you would have Caddy’s source unpacked in /usr/bin/caddy. Those commands don’t do that. You must have done something weird before then.

I assume you had installed with Install — Caddy Documentation ? Or did you install it another way (manually)?

Maybe reinstall Caddy with sudo apt remove caddy && sudo apt install caddy

1 Like

I followed this, as you posted.

I really have no idea what I could have done, all I can say is I’m a beginner on Ubuntu and haven’t understood everything. But I’m learning.

Okay, I’ll uninstall caddy, reinstall it and start again.

Okay, I uninstalled and reinstalled caddy, ran xcaddy build command and moved the file caddy from the /home directory following this Package support files for custom builds for Debian/Ubuntu/Raspbian

Then I restarted caddy and received an error:

Feb 01 07:01:27 PlexServer caddy[3581346]: LOGNAME=caddy
Feb 01 07:01:27 PlexServer caddy[3581346]: USER=caddy
Feb 01 07:01:27 PlexServer caddy[3581346]: INVOCATION_ID=e075884fb98f42a6bf4aaee87aa6c318
Feb 01 07:01:27 PlexServer caddy[3581346]: JOURNAL_STREAM=8:36250791
Feb 01 07:01:27 PlexServer caddy[3581346]: SYSTEMD_EXEC_PID=3581346
Feb 01 07:01:27 PlexServer caddy[3581346]: {"level":"info","ts":1706731287.907511,"msg":"using provided configuration","config_file":"/etc/caddy/Caddyfile","config_adapter":""}
Feb 01 07:01:27 PlexServer caddy[3581346]: Error: adapting config using caddyfile: parsing caddyfile tokens for 'tls': getting module named 'dns.providers.godaddy': module not registered: dns.providers.godaddy, at /etc/caddy/Caddyfile:21
Feb 01 07:01:27 PlexServer systemd[1]: caddy.service: Main process exited, code=exited, status=1/FAILURE
Feb 01 07:01:27 PlexServer systemd[1]: caddy.service: Failed with result 'exit-code'.
Feb 01 07:01:27 PlexServer systemd[1]: Failed to start caddy.service - Caddy.

It seems like it’s still using the default Caddy binary, not your custom one.

Run which caddy to see which binary is active. Then run caddy list-modules -s to see what plugins are included in that binary.

Show the output from update-alternatives --config caddy as well.

Thanks for your reply, I appreciate it.

skepticalme@PlexServer:~$ which caddy
/usr/bin/caddy
skepticalme@PlexServer:~$ caddy list-modules -s
dns.providers.godaddy

  Non-standard modules: 1

  Unknown modules: 0
skepticalme@PlexServer:~$ update-alternatives --config caddy
There are 2 choices for the alternative caddy (providing /usr/bin/caddy).

  Selection    Path                    Priority   Status
------------------------------------------------------------
  0            /usr/bin/caddy.custom    50        auto mode
  1            /usr/bin/caddy.custom    50        manual mode
* 2            /usr/bin/caddy.default   10        manual mode

Press <enter> to keep the current choice[*], or type selection number:

I change it to 0 (auto), and it seems to be working? No errors.

1 Like

There you go. :+1:

1 Like

Thank you so much for your help.

In my Caddyfile (above), do I delete anything like the subdomains, or are they all required?

You don’t need to write both https:// and :443, they’re redundant. Caddy defaults to HTTPS anyway, so you can simplify it to just stirlingpdf.sceptic.au {

Aside from that, I can’t say whether any sites are not needed, that’s entirely up to you to decide what you do and don’t need.

1 Like

Thank you!