ubergeek77 / Lemmy-Easy-Deploy

Deploy Lemmy the easy way!
MIT License
135 stars 16 forks source link

Lemmy unreachable #6

Closed arctis-shark closed 1 year ago

arctis-shark commented 1 year ago

I ran the deploy script and everything works but when I try accessing port 80 or 443 it says "This site can’t provide a secure connection" or "ERR_SSL_PROTOCOL_ERROR". Even if i try going to port 80 directly and specifying that I want http, it still gives me this error.

ubergeek77 commented 1 year ago

Can you give any more details about your setup? Sounds like Caddy wasn't able to generate certificates. Are your DNS records ok? Are you using Cloudflare? Gonna need more details here :p

Try going into the live folder and running:

docker compose -p lemmy-easy-deploy down
docker compose -p lemmy-easy-deploy up -d && docker compose -p lemmy-easy-deploy logs proxy -f

That will more than likely show some errors that I need info from.

Also, if you're trying to access it by direct IP/port instead of using a domain name, that won't work.

arctis-shark commented 1 year ago

Oh ok, thanks for the tip. I tried running the commands and it gave me this: Error response from daemon: failed to create task for container: failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: error during container init: error mounting "/caddy/Caddyfile" to rootfs at "/etc/caddy/Caddyfile": mount /caddy/Caddyfile:/etc/caddy/Caddyfile (via /proc/self/fd/6), flags: 0x5001: not a directory: unknown: Are you trying to mount a directory onto a file (or vice-versa)? Check if the specified host path exists and is the expected type Also, yes, I am using cloudflare. The nameservers have been changed to cloudflare's sucessfully.

ubergeek77 commented 1 year ago

What system are you running on? I've only seen this error from a user using Proxmox. The user reported they had to turn on nested virtualization (isolation?) first. Some Proxmox setting I believe.

arctis-shark commented 1 year ago

Yes, I am running Ubuntu Server on Proxmox.

ubergeek77 commented 1 year ago

Before you turn that setting on, help me test something:

Do you get the same/similar error if you run:

docker run --rm -it hello-world

If you do, I can add some Proxmox detection in my script to better help people with this issue in the future.

arctis-shark commented 1 year ago

Nope, it runs completely fine without errors. Lemmy also ran correctly the first time, it's only the 2nd time that it gives me an error.

ubergeek77 commented 1 year ago

How about:

docker run --rm -it -v "$(pwd):/host" hello-world

Based on the error message you posted, this seems to be related to volumes. However, this is still definitely a Proxmox specific issue:

https://lemmy.ubergeek77.chat/comment/127443

arctis-shark commented 1 year ago

Still runs fine

ubergeek77 commented 1 year ago

Can you post your generated docker-compose.yml? Redact anything sensitive. But the path in your error message is missing a very important dot:

error mounting "/caddy/Caddyfile" to rootfs at "/etc/caddy/Caddyfile": mount /caddy/Caddyfile:/etc/caddy/Caddyfile (via /proc/self/fd/6), 

It should be ./caddy/Caddyfile.

I'd also like to see the Docker version information printed by deploy.sh. You can run it once without arguments to see that. Maybe Proxmox or your version of Docker is doing something weird with paths.

ubergeek77 commented 1 year ago

Actually I think I see the issue already:

$PWD/caddy/Caddyfile:/etc/caddy/Caddyfile:ro

I'll have to look into why that $PWD is being interpreted as a blank string. This is the first I've ever seen this.

Does your shell have the $PWD variable in its environment?

arctis-shark commented 1 year ago

image

ubergeek77 commented 1 year ago

Try replacing $PWD in docker-compose.yml.template with simply a ., so the path becomes ./caddy/Caddyfile, then run ./deploy.sh -f.

If that works, I'll push this change. After I've pushed an update, you can update Lemmy Easy Deploy by running:

git checkout ./templates/docker-compose.yml.template
git pull
arctis-shark commented 1 year ago

It updated and now it works fine but if I go to my domain name it says "ERR_TOO_MANY_REDIRECTS". I have port forwarded 80 and 443 and they show up in the nmap scan.

ubergeek77 commented 1 year ago

Please check out the troubleshooting section, you probably need to change your Cloudflare SSL mode to Full or Full (Strict).

arctis-shark commented 1 year ago

It works now, thanks!

ubergeek77 commented 1 year ago

You're welcome! Thank you for helping me test!