Server Error 500 after fresh install
Surgical71 opened this issue · 15 comments
Server error 500 after fresh docker-compose install
Current Behavior
-- Server error 500. Both App container and SQL container runs as expected and provides a IP
Steps to Reproduce
- Launched stack via Portainer and docker compose
- Connected to container via NGINX proxy manager
Environment
OS:
-- Ubuntu Server
CPU architecture:
-- arm64
How docker service was installed:
-- Via Portainer
Command used to create docker container (run/create/compose/screenshot)
version: "3"
services:
mysql:
image: lscr.io/linuxserver/mariadb:latest
container_name: snipe_mysql
restart: unless-stopped
volumes:
- /home/ubuntu/DockerCompose/snipe/data:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=(My password)
- MYSQL_USER=snipe
- MYSQL_PASSWORD=(My password)
- MYSQL_DATABASE=snipe
snipeit:
image: lscr.io/linuxserver/snipe-it:latest
container_name: snipe-it
restart: unless-stopped
depends_on:
- mysql
volumes:
- /home/ubuntu/DockerCompose/snipe/config:/config
environment:
- APP_URL=https://inventory.venncubed.com
- MAIL_PORT_587_TCP_ADDR=smtp.office365.com
- MAIL_PORT_587_TCP_PORT=587
- MAIL_ENV_FROM_ADDR=(my domain email)
- MAIL_ENV_FROM_NAME=Snipe
- MAIL_ENV_ENCRYPTION=tls
- MAIL_ENV_USERNAME=(my domain email)
- MAIL_ENV_PASSWORD=(My password)
- MYSQL_PORT_3306_TCP_ADDR=mysql
- MYSQL_PORT_3306_TCP_PORT=3306
- MYSQL_DATABASE=snipe
- MYSQL_USER=snipe
- MYSQL_PASSWORD=(My password)
- PGID=1000
- PUID=1000
- TZ=ZA
ports:
- "8084:80"
- "8083:443"
Docker logs
_ ()
| | ___ _ __
| | / __| | | / \
| | \__ \ | | | () |
|_| |___/ |_| \__/
Brought to you by linuxserver.io
To support the app dev(s) visit:
Snipe-IT: https://snipeitapp.com/donate
To support LSIO projects visit:
https://www.linuxserver.io/donate/
GID/UID
User uid: 1000
User gid: 1000
cont-init: info: /etc/cont-init.d/10-adduser exited 0
cont-init: info: running /etc/cont-init.d/20-config
cont-init: info: /etc/cont-init.d/20-config exited 0
cont-init: info: running /etc/cont-init.d/30-keygen
using keys found in /config/keys
cont-init: info: /etc/cont-init.d/30-keygen exited 0
cont-init: info: running /etc/cont-init.d/40-config
cont-init: info: /etc/cont-init.d/40-config exited 0
cont-init: info: running /etc/cont-init.d/99-custom-files
[custom-init] No custom files found, skipping...
cont-init: info: /etc/cont-init.d/99-custom-files exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service init-mods: starting
s6-rc: info: service init-mods successfully started
s6-rc: info: service init-mods-package-install: starting
s6-rc: info: service init-mods-package-install successfully started
s6-rc: info: service init-mods-end: starting
s6-rc: info: service init-mods-end successfully started
s6-rc: info: service init-services: starting
s6-rc: info: service init-services successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun cron (no readiness notification)
services-up: info: copying legacy longrun nginx (no readiness notification)
services-up: info: copying legacy longrun php-fpm (no readiness notification)
s6-rc: info: service legacy-services successfully started
s6-rc: info: service 99-ci-service-check: starting
[ls.io-init] done.
s6-rc: info: service 99-ci-service-check successfully started
I've just come here to create exactly same issue. Was trying to do something with it the whole day yesterday with no luck.
My docker-compose.yaml
is nearly the same too:
---
version: "2.1"
services:
db:
image: lscr.io/linuxserver/mariadb:latest
environment:
- PUID=1026
- PGID=100
- TZ=Europe/Berlin
- MYSQL_ROOT_PASSWORD=<root-pass>
- MYSQL_DATABASE=snipeit
- MYSQL_USER=snipeit
- MYSQL_PASSWORD=<pass>
volumes:
- <data-folder>/db:/config
restart: unless-stopped
web:
image: lscr.io/linuxserver/snipe-it:latest
depends_on:
- db
healthcheck:
test: ["CMD", "curl", "-fs", "-S", "--max-time", "2", "http://localhost:80"]
interval: 30s
timeout: 10s
retries: 5
environment:
- PUID=1026
- PGID=100
- TZ=Europe/Berlin
- APP_URL=http://192.168.2.10:8080
- MYSQL_PORT_3306_TCP_ADDR=db
- MYSQL_PORT_3306_TCP_PORT=3306
- MYSQL_DATABASE=snipeit
- MYSQL_USER=snipeit
- MYSQL_PASSWORD=<pass>
volumes:
- <data-folder>/config:/config
ports:
- 8080:80
restart: unless-stopped
Can you test lspipepr/snipe-it:v6.0.11-pkg-2eb37743-pr-28
and leave a comment on #28 to let us know if it works or if you have any issues?
I don't know if #28 addresses the issue here, but there are significant changes incoming and it might. If not, we'll need a bit more information, specifically the nginx error logs from /config/log/nginx/error.log
and possibly other logs as well.
Can you test
lspipepr/snipe-it:v6.0.11-pkg-2eb37743-pr-28
and leave a comment on #28 to let us know if it works or if you have any issues?I don't know if #28 addresses the issue here, but there are significant changes incoming and it might. If not, we'll need a bit more information, specifically the nginx error logs from
/config/log/nginx/error.log
and possibly other logs as well.
Same Issue
I was getting this problem, a look at /config/log/nginx/error.log
showed a number of complaints about my chosen time zone.
After setting TZ=US/Eastern
in the application environment variables and redeploying, there have been no further problems. Unlike some other applications, snipe-it is naturally pretty quiet and the lack of meaningful output in the container log other than the usual LSIO stuff is normal.
In my case the /config/log/nginx/error.log
is full of the following:
2022/10/23 19:11:25 [error] 28640#28640: *21166 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught InvalidArgumentException: Please provide a valid cache path. in /var/www/html/vendor/laravel/framework/src/Illuminate/View/Compilers/Compiler.php:36
Stack trace:
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/View/ViewServiceProvider.php(88): Illuminate\View\Compilers\Compiler->__construct()
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(873): Illuminate\View\ViewServiceProvider->Illuminate\View\{closure}()
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(758): Illuminate\Container\Container->build()
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(851): Illuminate\Container\Container->resolve()
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(694): Illuminate\Foundation\Application->resolve()
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(836): Illuminate\Container\Container->make...
Ah, okay, the problem in my case is with the volume that I mount. It doesn't like something in the permissions I suppose because if I don't map it to the folder but just use a named docker volume, it works.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Still doesn't work on :latest
image:
2022/12/11 19:29:30 [error] 201#201: *4 FastCGI sent in stderr: "PHP message: PHP Notice: date_default_timezone_set(): Timezone ID 'Europe/Warsaw
' is invalid in /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 49" while reading response header from upstream, client: 172.18.0.7, server: <redacted>, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<redacted>"
None of TZ settings changes work:
2022/12/11 13:45:29 [error] 201#201: *1 FastCGI sent in stderr: "PHP message: PHP Notice: date_default_timezone_set(): Timezone ID 'US/Eastern
' is invalid in /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 49" while reading response header from upstream, client: 172.18.0.7, server: <redacted>, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<redacted>"
2022/12/11 18:35:45 [error] 203#203: *1 FastCGI sent in stderr: "PHP message: PHP Notice: date_default_timezone_set(): Timezone ID 'UTC
' is invalid in /app/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/LoadConfiguration.php on line 49" while reading response header from upstream, client: 172.18.0.7, server: <redacted>, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "<redacted>"
It looks like a line break is getting added to the end of the TZ somehow
This is the Laravel error I'm getting on :latest but there are no errors in nginx access.log or php access.log.
This occurs whether via reverse proxy or straight to the container.
[2022-12-26 11:44:13] production.ERROR: Header may not contain more than a single header, new line detected {"exception":"[object] (ErrorException(code: 0): Header may not contain more than a single header, new line detected at /app/www/vendor/symfony/http-foundation/Response.php:359) [stacktrace] #0 [internal function]: Illuminate\\Foundation\\Bootstrap\\HandleExceptions->handleError() #1 /app/www/vendor/symfony/http-foundation/Response.php(359): header() #2 /app/www/vendor/symfony/http-foundation/Response.php(393): Symfony\\Component\\HttpFoundation\\Response->sendHeaders() #3 /app/www/vendor/laravel/framework/src/Illuminate/Support/HigherOrderTapProxy.php(34): Symfony\\Component\\HttpFoundation\\Response->send() #4 /app/www/public/index.php(53): Illuminate\\Support\\HigherOrderTapProxy->__call() #5 {main} "}
I think it's because this is using echo and not printf https://github.com/linuxserver/docker-snipe-it/blob/master/root/etc/cont-init.d/40-config#L75-L78
I'll see if I can PR a fix for people to test.
OK, @devvick @madtempest can you test with lspipepr/snipe-it:v6.0.14-pkg-2013becd-pr-48
, it should fix all the issues introduced by version 6 having a dislike for spurious newlines.
If you've got an existing .env file in /config it'll need to be deleted (or fix the newlines by hand, or use a completely clean /config mount).
OK, @devvick @madtempest can you test with
lspipepr/snipe-it:v6.0.14-pkg-2013becd-pr-48
, it should fix all the issues introduced by version 6 having a dislike for spurious newlines.If you've got an existing .env file in /config it'll need to be deleted (or fix the newlines by hand, or use a completely clean /config mount).
I can confirm that this seems to fix the issue for me. No more server 500 errors and I can authenticate and browse assets correctly.
Thank you.
PR is merged and should build and push to live in the next ~30 minutes.