Trouble running MediaCMS: “Server Error (500)” on logging in.
from Tiritibambix@lemmy.ml to selfhosted@lemmy.world on 21 Apr 11:50
https://lemmy.ml/post/14714883

Hey there!

I’m a self-hosting enthusiast, and I’m learning the hard way, so I appreciate your patience as I navigate through this.

I’ve been on the hunt for a video hosting solution that offers categories and tags, and I’ve heard great things about MediaCMS. It seems like the perfect fit for what I need.

After some trial and error, I finally got it up and running. The only hiccup I’m facing now is with logging into the admin panel. I keep getting an error 500. I checked out some similar issues on github, but it doesn’t seem to apply to my situation, and there isn’t a solution posted. Plus, it looks like the developer is not very active on the issues.

I was wondering if anyone else has encountered this problem before and might have some insights to share.

Here’s some additional info: I cloned the repository from github.com/mediacms-io/mediacms and made some edits to the docker-compse.yaml file to suit my preferences, mainly adjusting the volume paths. You can check it out here. The service takes a bit of time to start, but eventually it does and I can access the landing page. However, when I try to sign in, I just get a “Server Error (500)” message. I’ve checked the logs but haven’t found anything useful.

Has anyone who uses MediaCMS encountered this issue before? Can someone reproduce and help me clear this out? Thanks a lot for your assistance!

#selfhosted

threaded - newest

catloaf@lemm.ee on 21 Apr 11:59 next collapse

Does it have logs?

YurkshireLad@lemmy.ca on 21 Apr 12:03 next collapse

Spot on. You can’t self host without reading app and system logs.

Tiritibambix@lemmy.ml on 21 Apr 12:08 collapse

celery_beat

celery_worker

db. A lot of errors here, but I think I recall reading somewhere in the issues that it doesn’t matter. I’d have to double check that.

redis

web

catloaf@lemm.ee on 21 Apr 12:32 next collapse

I don’t think postgres having fatal errors like that is normal. I’d check the user it’s running as and the permissions on the files/directories/volumes.

aodhsishaj@lemmy.world on 21 Apr 13:36 collapse

You have a permissions issue with pg_logical/snapshots": Permission denied. Check that your volumes exist in /var/lib/docker/container (or something close) and that the user running docker can create a test file in the local directory (likely a db directory in the docker root)

What’s your docker-compose.yml look like? Especially any volume mounts

Tiritibambix@lemmy.ml on 21 Apr 14:13 collapse

I have the folder. I chown and chmod it as it should be. Looks like it reverts back to the wrong permissions though. Don’t know why.

Here is my docker-compose

N0x0n@lemmy.ml on 21 Apr 12:11 next collapse

Try to open the web developer tools in your web browser, to look if there is anything useful. It’s different for every browser but on firefox: ≡ > more tools > Web Developer tools. Look into the network tab and refresh your page and try to login again. This can sometimes give you some hints what’s going wrong.

Also have you tried to log every container from the compose?

When you ls all containers do they seem healthy or does one do not start? docker container ls -a ?

Tiritibambix@lemmy.ml on 21 Apr 12:26 collapse

Thanks for your answer. I’m not sure what to look for in the browser’s logs but here it is.

I have logs for all containers here:

celery_beat

celery_worker

db. A lot of errors here, but I think I recall reading somewhere in the issues that it doesn’t matter. I’d have to double check that.

redis

web

I have one container exited, mediacms_migrations, but I noticed it stopped right after the stack’s setup and thought it would be used only for startup. Here are the logs for it

orhtej2@eviltoast.org on 21 Apr 13:02 collapse

It looks like db is fried, I’d assume all the permission errors prevent it from running normally. Is there a healthcheck configured?

N0x0n@lemmy.ml on 21 Apr 13:13 collapse

I just spinned up the docker compose bare bone without any modification just to see if it actually works on localhost. Just a checkup to see if by default it works, and yes I can login from my host IP:PORT without any issues.

github.com/mediacms-io/mediacms/…/admins_docs.md#…

I just changed the default port, because 80 is already used and gave the admin account a password.

Maybe this github anwser can be helpful ??

The compose stack seems not that easy to customize, In your position I would mount it bare bone a change things one/one reading through their admin docs !

My guess would be that changing the volume a few things are missing? I don’t know, docker issues a hard to troubleshoot when you’re not infront of the computer.

Tiritibambix@lemmy.ml on 21 Apr 13:36 collapse

Thanks for trying. The issue you mentioned helped me before to have it spinning. I feel like I’ve tried everything mentioned in the docs as well as what I am aware of and capable of 😅

N0x0n@lemmy.ml on 21 Apr 13:47 collapse

Yeah, sorry about that… Seems alot of python is involved.

Can you check your permission on “pg_logical/snapshots” in your folder ?

drwx------ 1 70 root 512 Apr 21 15:40 postgres_data

drwx------ 1 70 70 0 Apr 21 14:41 pg_snapshots

Tiritibambix@lemmy.ml on 21 Apr 14:10 collapse

I manually set it to 777 several times for testing purposes, but apparently, it switches back to 700

N0x0n@lemmy.ml on 21 Apr 14:28 collapse

Here is something you can work on. You could try to mount your volumes as named volume as per this docker-compose file, so that docker takes care of permissions and ownership of the files.

If I understand it correctly you want to use an external drive or a drive partition ? You can’t directly use those partitions as named volume. You can also mount a SAMBA/CIF mounted volume from your external drive/drive partition or NFS (read here).

Do not change this part in the docker-compose I shared above. This files needs to be located where It can find it.

    volumes:
      - ./deploy/docker/local_settings.py:/home/mediacms.io/mediacms/deploy/docker/local_settings.py

This is what I would give a try. Apart from that, I can’t help you any further, maybe someone else would come up with a better idea :/.

This seems like a stupid permission issue ˆˆ’. Hope you will find your way arround !

Tiritibambix@lemmy.ml on 21 Apr 15:03 next collapse

Still no luck, but thanks for trying :)

Tiritibambix@lemmy.ml on 21 Apr 15:44 collapse

Okay so I tried again, but only changing port. It worked. I really wish I could figure out this permission issues and bond volumes. Thanks again for your help :)