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

[Bug]: Reported 500 Internal Sever Error after Fresh Install #2912

Closed
Chengregnarok opened this issue Jan 23, 2025 · 15 comments
Closed

[Bug]: Reported 500 Internal Sever Error after Fresh Install #2912

Chengregnarok opened this issue Jan 23, 2025 · 15 comments
Assignees
Labels

Comments

@Chengregnarok
Copy link

What is your set up?

Self Hosted Docker

Version

3.3.3

Describe the issue

I'm a newbee on docker and following the instruction of https://github.com/Leantime/docker-leantime?tab=readme-ov-file (which I believe the official doc), running this on my self-own synology device. After docker-compose.yaml ran successfully, I tried to log on through :/install, but showing below message:

Oops! An Error Occurred
The server returned a "500 Internal Server Error".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.

And further I check mysql container. No tables are generated at all
my files:
.env: (only below changed, rest kept same)

LEAN_PORT = '18001' # The port to expose and access Leantime
LEAN_APP_URL = 'http://192.168.31.42' # Base URL, needed for subfolder or proxy installs (including http:// or https://)
LEAN_APP_DIR = '/leantime' # Base of application without trailing slash (used for cookies), e.g, /leantime

LEAN_DEBUG = 0 # Debug flag

Database - MySQL container

MYSQL_ROOT_PASSWORD = 'Seed2Die.' # MySQL root password
MYSQL_DATABASE = 'leantime' # Database name
MYSQL_USER = 'lean' # Database username
MYSQL_PASSWORD = 'Seed2Die.' # Database password

Database - leantime container

LEAN_DB_HOST = '192.168.31.42' # Database host
LEAN_DB_USER = 'lean' # Database username (needs to be the same as MYSQL_USER)
LEAN_DB_PASSWORD = 'Seed2Die.' # Database password (needs to be the same as MYSQL_PASSWORD)
LEAN_DB_DATABASE = 'leantime' # Database name (needs to be the same as MYSQL_DATABASE)
LEAN_DB_PORT = '3309' # Database port

docker-compose.yaml:

version: '3.3'

services:
leantime_db:
image: mysql:8.0.33
container_name: mysql_leantime
volumes:
- db_data:/var/lib/mysql
restart: unless-stopped
env_file: ./.env # Environment file with settings
networks:
- leantime-net
command: --character-set-server=UTF8MB4 --collation-server=UTF8MB4_unicode_ci

leantime:
image: leantime/leantime:latest
container_name: leantime
restart: unless-stopped
env_file: ./.env # Environment file with settings
networks:
- leantime-net
volumes:
- public_userfiles:/var/www/html/public/userfiles # Volume to store public files, logo etc
- userfiles:/var/www/html/userfiles # Volume to store private user uploaded files
- plugins:/var/www/html/app/Plugins # Uncomment if you are planning to use plugins from the marketplace
ports:
- "${LEAN_PORT}:80" # The port to expose and access Leantime
depends_on:
- leantime_db # Don't start Leantime unless leantime_db is running

volumes:
db_data:
userfiles:
public_userfiles:
plugins:

networks:
leantime-net:

Reproduction steps

  1. setup .env file
  2. run docker-compose.yaml
  3. goto :/install
    ...

Error Logs (LEANTIMEFOLDER/storage/logs)

Docker Container Log
2025/01/24 00:30:13 | stderr | 127.0.0.1 -  23/Jan/2025:16:30:13 +0000 "GET /index.php" 500

@marcelfolaron
Copy link
Contributor

Any errors in the leantime containers /var/www/html/storage/logs directory? 

@Chengregnarok
Copy link
Author

Well... not sure if the right command:

  • command
    docker exec -it leantime /bin/bash
  • response
    OCI runtime exec failed: exec failed: unable to start container process: exec: "/bin/bash": stat /bin/bash: no such file or directory: unknown

@Chengregnarok
Copy link
Author

I tried another way on official readme file
my command:
docker run -d --restart unless-stopped -p 10081:80
-e LEAN_DB_HOST=192.168.31.42:3308
-e LEAN_DB_USER=root
-e LEAN_DB_PASSWORD=Seed2Die.
-e LEAN_DB_DATABASE=leantime
--volume /volume1/docker/leantime:/var/www/html/storage/logs
--name leantime2 leantime/leantime:latest

and the logs I get:
leantime2.zip

After all --volume doesn't help me anything I can't get any file or logs in my folder.

@fabiansteiner
Copy link

...same problem here!

@jaredpaquet4ufl
Copy link

I'm having the same issue on fresh Ubuntu 22.04 server package installation. No errors in logs for leantime, php, apache/nginx

@fabiansteiner
Copy link

Update: I messed up with the passwords the first try. (I entered different passwords in the .env file for the MySQL user where it should be the same) Then I noticed and deleted containers and images ,did the setup again and it still did not work, because I forgot to delete the volumes. After deleting the volumes I tried again and it worked.

@Chengregnarok
Copy link
Author

Chengregnarok commented Jan 30, 2025

Update: I messed up with the passwords the first try. (I entered different passwords in the .env file for the MySQL user where it should be the same) Then I noticed and deleted containers and images ,did the setup again and it still did not work, because I forgot to delete the volumes. After deleting the volumes I tried again and it worked.

Then not the same case. For my numerous trials, kept not working no matter I delete schemas in MySQL, create new MySQL container.
But anyway, congratulations on your problem being fixed.

@marcelfolaron
Copy link
Contributor

@Chengregnarok I missed that this was a synology. I did some experimentation with the synology over the weekend and ran into some interesting issues. 1. Synology creates a specific set of permissions with regards to the volumes and where you store it. When I tried to store volumes in a designated folder (volume1/docker/myfolder). It would fail. If I left the volumes be handled by Synlogy (just don't add a path definition and just use myvolumeName:/var... it would store it in volume1/@docker/Volumes which would work.

Overall for synology I am now suggesting to go through the GUI and not the commandline. The Synology package is doing something under the hood I cannot explain at this point.

So steps would be:

  1. Create a new network (leantime-net)
  2. Create mysql container and add to that network)
  3. Create leantime container.

Doing this through the UI worked without any issues.

PS: I had various old volumes in volume1/@Docker/Volumes from previous leantime installs that were not removed when I deleted the containers. I ended up removing them manually. This may be needed here as well.

@Chengregnarok
Copy link
Author

@Chengregnarok I missed that this was a synology. I did some experimentation with the synology over the weekend and ran into some interesting issues. 1. Synology creates a specific set of permissions with regards to the volumes and where you store it. When I tried to store volumes in a designated folder (volume1/docker/myfolder). It would fail. If I left the volumes be handled by Synlogy (just don't add a path definition and just use myvolumeName:/var... it would store it in volume1/@docker/Volumes which would work.

Overall for synology I am now suggesting to go through the GUI and not the commandline. The Synology package is doing something under the hood I cannot explain at this point.

So steps would be:

  1. Create a new network (leantime-net)
  2. Create mysql container and add to that network)
  3. Create leantime container.

Doing this through the UI worked without any issues.

PS: I had various old volumes in volume1/@Docker/Volumes from previous leantime installs that were not removed when I deleted the containers. I ended up removing them manually. This may be needed here as well.

Well... still not working for me.

Image
The only feedback in the logs is the 4 lines shown in the snapshot every time I tried to login.

the setting of leantime container
Image

the setting of mysql container
Image

hope this could help to find out what I done wrong...

@Chengregnarok
Copy link
Author

And I just tried on my Tencent server for the same setting but also failed with same problem. So this might not a Synology problem and might be a "setting issue".

@marcelfolaron
Copy link
Contributor

Thanks for sharing the screenshot. I think I see where the issue is. To change the port for the db connection please use the config variable: LEAN_DB_PORT
The db host should only be the host url. (As it is written right now it would be concatenated to 192.168.31.42:3309:3306 )

@Chengregnarok
Copy link
Author

Thanks for sharing the screenshot. I think I see where the issue is. To change the port for the db connection please use the config variable: LEAN_DB_PORT The db host should only be the host url. (As it is written right now it would be concatenated to 192.168.31.42:3309:3306 )

Well... thanks for checking... but seems no progress

Image
this is what kept shown when I done all settings and press the login button

Image
the error logs remain no difference from my view

Image
new settings taken your advice, hopefully I get your point.

Again Same on my tencent server. Not a synology only problem.

@marcelfolaron
Copy link
Contributor

I see. Several thoughts:

  • Does your docker user have permissions to write to the file system? Sessions are stored inside of /storage/framework/sessions
  • Do you have cookies enabled? Leantime stores the session id in a cookie
  • It appears you are accessing Leantime via http and not https? Please set LEAN_SESSION_SECURE to false

@Chengregnarok
Copy link
Author

Chengregnarok commented Feb 4, 2025

I see. Several thoughts:

  • Does your docker user have permissions to write to the file system? Sessions are stored inside of /storage/framework/sessions
  • Do you have cookies enabled? Leantime stores the session id in a cookie
  • It appears you are accessing Leantime via http and not https? Please set LEAN_SESSION_SECURE to false

It works after I put in setting LEAN_SESSION_SECURE = FALSE. So finally this is the key! Thanks!

@marcelfolaron
Copy link
Contributor

Thanks for the update! Glad it works now.

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

No branches or pull requests

4 participants