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

Error 500 when accessing Admin-General page #849

Closed
b2eboy opened this issue Oct 4, 2023 · 49 comments
Closed

Error 500 when accessing Admin-General page #849

b2eboy opened this issue Oct 4, 2023 · 49 comments
Assignees
Labels
🐛 bug Something isn't working

Comments

@b2eboy
Copy link

b2eboy commented Oct 4, 2023

Describe the bug
I have very fresh installation of Speedtest Tracker. I just set up the new user accounts, re-login to new admin name and tried to open Settings->General page. The loading takes more seconds than usual and then show "500 Server Error".
In "docker logs" output I don't see anything possibly related to some error. Last 2 lines of the log:

\\n[previous exception] Over 9 levels deep, aborting normalization"}
10.0.2.30 - - [04/Oct/2023:13:24:31 +0200] "GET /admin/general-page HTTP/1.1" 500 6628 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0"

To Reproduce
Steps to reproduce the behavior:

  1. Make fresh deployment / today's latest version
  2. Login by default admin/password account
  3. Create 1 new admin account and 1 new user account
  4. Log out
  5. Log in with new admin account
  6. Delete old admin account
  7. Click to Options->General

Expected behavior
Page with settings should be displayed.

Environment (please complete the following information):

  • OS: Debian 11 + Docker
  • Architecture: x86_64 GNU/Linux
  • Browser Firefox latest/Windows
  • Version 0.13.1

Logs

\\n[previous exception] Over 9 levels deep, aborting normalization"}
10.0.2.30 - - [04/Oct/2023:13:24:31 +0200] "GET /admin/general-page HTTP/1.1" 500 6628 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/117.0"

Additional context
My docker run settings:

    docker run -d --name speedtest-tracker --restart unless-stopped \
    -p 8765:80 \
    -p 8766:443 \
    -e PUID=2511 \
    -e PGID=2511 \
    -e TZ=Europe/Prague \
    -e DB_CONNECTION=mysql \
    -e DB_HOST=10.0.3.1 \
    -e DB_PORT=3306 \
    -e DB_DATABASE=speedtest \
    -e DB_USERNAME=speedtest \
    -e DB_PASSWORD=XXXXXXXXX \
    -v /etc/localtime:/etc/localtime:ro \
    -v /docker/data/speedtest_tracker/config:/config \
    -v /docker/data/speedtest_tracker/directory/web:/etc/ssl/web \
    ghcr.io/alexjustesen/speedtest-tracker:latest


@alexjustesen
Copy link
Owner

Why are you deleting the initial admin account?

@b2eboy
Copy link
Author

b2eboy commented Oct 4, 2023

Why are you deleting the initial admin account?

To disable the default admin account is just a security habbit from different products. Do you think this is related to the HTTP 500 error?

@b2eboy
Copy link
Author

b2eboy commented Oct 4, 2023

I created it back for testing if it helps, but the behavior is the same.
I also changed MariaDB line index of the "Admin" back to number 1 (as this was 4 after manual re-creation), also the same behavior.

@alfredros
Copy link

Same for me, after upgrading docker image, error 500 appears on admin page.

@DustoMan
Copy link

DustoMan commented Oct 4, 2023

I don't know if it's relevant but I'm getting this error in my logs:

[2023-10-04 15:26:24] production.ERROR: No application encryption key has been specified. {"exception":"[object] (Illuminate\Encryption\MissingAppKeyException(code: 0): No application encryption key has been specified. at /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:79)

I was getting error 500 on the last version, but then restarting the docker container would at least let me log in once. Now I restart and I'm still getting error 500.

@krelltunez
Copy link

My docker install ran smoothly until updating my container today. Now I also get Error 500.

@tismofied
Copy link

tismofied commented Oct 4, 2023

The exact same error as @DustoMan and others. I have watchtower auto update the container and I never touched it since I set it up the first time.
getting 500 | server error

@Unrepentant-Atheist
Copy link

Unrepentant-Atheist commented Oct 4, 2023

Same here. Always been updating with watchtower without a problem, last update Error 500.

Dozzle says

18:21:35
[2023-10-04 16:21:35] production.ERROR: No application encryption key has been specified. {"exception":"[object] (Illuminate\\Encryption\\MissingAppKeyException(code: 0): No application encryption key has been specified. at /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php:79)
10/04/2023
18:21:35
[stacktrace]
10/04/2023
18:21:35
#0 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/helpers.php(307): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}()
10/04/2023
18:21:35
#1 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(77): tap()
10/04/2023
18:21:35
#2 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(60): Illuminate\\Encryption\\EncryptionServiceProvider->key()
10/04/2023
18:21:35
#3 /var/www/html/vendor/laravel/framework/src/Illuminate/Encryption/EncryptionServiceProvider.php(32): Illuminate\\Encryption\\EncryptionServiceProvider->parseKey()
10/04/2023
18:21:35
#4 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(908): Illuminate\\Encryption\\EncryptionServiceProvider->Illuminate\\Encryption\\{closure}()
10/04/2023
18:21:35
#5 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build()
10/04/2023
18:21:35
#6 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(937): Illuminate\\Container\\Container->resolve()
10/04/2023
18:21:35
#7 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve()
10/04/2023
18:21:35
#8 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(922): Illuminate\\Container\\Container->make()
10/04/2023
18:21:35
#9 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(1066): Illuminate\\Foundation\\Application->make()
10/04/2023
18:21:35
#10 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(982): Illuminate\\Container\\Container->resolveClass()
10/04/2023
18:21:35
#11 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(943): Illuminate\\Container\\Container->resolveDependencies()
10/04/2023
18:21:35
#12 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(795): Illuminate\\Container\\Container->build()
10/04/2023
18:21:35
#13 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(937): Illuminate\\Container\\Container->resolve()
10/04/2023
18:21:35
#14 /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php(731): Illuminate\\Foundation\\Application->resolve()
10/04/2023
18:21:35
#15 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(922): Illuminate\\Container\\Container->make()
10/04/2023
18:21:35
#16 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(255): Illuminate\\Foundation\\Application->make()
10/04/2023
18:21:35
#17 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(213): Illuminate\\Foundation\\Http\\Kernel->terminateMiddleware()
10/04/2023
18:21:35
#18 /var/www/html/public/index.php(55): Illuminate\\Foundation\\Http\\Kernel->terminate()
10/04/2023
18:21:35
#19 {main}
10/04/2023
18:21:35
"} ```

@RobertD502
Copy link

RobertD502 commented Oct 4, 2023

To get around this, run docker exec -ti name_of_your_container /bin/bash, when inside the container run the following command php artisan key:generate --show copy the output as you'll need to set the APP_KEY environment variable to it (either in your compose file or within your docker run command).

Example: APP_KEY="base64:23423h4v23hg4v2j34bvc1y231v2y3"

@hummelmose
Copy link

hummelmose commented Oct 4, 2023

I have the same issue - Error 500 constantly - Updating from Portainer.

But did use @RobertD502's tip, and that solved the issue 👍

Set the following into my portainer config under environment:

  • APP_KEY="base64:API KEY FOUND IN THE COMMAND ABOVE"

@upD8R
Copy link

upD8R commented Oct 4, 2023

Big shoutout to @RobertD502 - your workaround solved the issue here, too.

@MarcusSi2023
Copy link

same issue on Unraid

@alexjustesen
Copy link
Owner

To get around this, run docker exec -ti name_of_your_container /bin/bash, when inside the container run the following command php artisan key:generate --show copy the output as you'll need to set the APP_KEY environment variable to it (either in your compose file or within your docker run command).

Example: APP_KEY="base64:23423h4v23hg4v2j34bvc1y231v2y3"

This is the way...

Also of note, there isn't a good process for nuking the old .env file without destroying some settings by accident. I suggest...

  1. Copy the contents of the .env file from the mounted drive or volume
  2. Delete it
  3. Restart the container and let it copy in the new one
  4. Port over any of your custom changes (i.e. Telegram token or SMTP configs)

@DustoMan
Copy link

DustoMan commented Oct 4, 2023

same issue on Unraid

I was able to do @RobertD502 instructions on Unraid to get it going slightly modified. Click on icon for the SpeedTest Tracker docker container. Bring up the Console. Use the php command to have it generate a key. Copy the key to the clipboard. Then go to the container settings and add the APP_KEY environment variable by clicking "Add another Path, Port, Variable, Label or Device" link at the bottom of the settings page. In the popup select the Config Type: to Variable. Enter "APP_KEY" in the Name and Key fields. Then paste in the "base64:generatedkey" into the Value field. Then Save and Apply the change. You should get the login screen now after the docker restarts.

@MarcusSi2023
Copy link

same issue on Unraid

I was able to do @RobertD502 instructions on Unraid to get it going slightly modified. Click on icon for the SpeedTest Tracker docker container. Bring up the Console. Use the php command to have it generate a key. Copy the key to the clipboard. Then go to the container settings and add the APP_KEY environment variable by clicking "Add another Path, Port, Variable, Label or Device" link at the bottom of the settings page. In the popup select the Config Type: to Variable. Enter "APP_KEY" in the Name and Key fields. Then paste in the "base64:generatedkey" into the Value field. Then Save and Apply the change. You should get the login screen now after the docker restarts.

Amazing, thanks! I was really struggling to figuire out how to do this and this was a lifesaver!

@b2eboy
Copy link
Author

b2eboy commented Oct 4, 2023

Gentlemen, please, help me to figure out, what I am doing wrong.
I am trying to follow all of the steps described in the posts above. Again and again. But I am not success.
I did rm&rmi and fresh pull, so I have new container.

  1. I issued php artisan key:generate --show, copied a key. Pasted to .env file as APP_KEY. Restart container. No success, still error 500.
  2. I used portainer to recreate a container with new env to APP_KEY=my-key, so I have running container with the value in it's environment, AND the same key in .env file. Restarted container. No success, still error 500.

The explained steps from the posts above looks very clear and easy, but it simply does not do a trick for me.
What I am missing?

My .env file

# Used for encryption where needed, if a key is not generated run: php artisan key:generate
APP_KEY="base64:YWT8xVsZ9hBDNyc9VGtZ/dAmIP575g+nsjAEJ8OwP+E"
docker inspect speedtest-tracker  | grep APP_KEY
                "APP_KEY=base64:YWT8xVsZ9hBDNyc9VGtZ/dAmIP575g+nsjAEJ8OwP+E"

Thank you

@RobertD502
Copy link

Gentlemen, please, help me to figure out, what I am doing wrong. I am trying to follow all of the steps described in the posts above. Again and again. But I am not success. I did rm&rmi and fresh pull, so I have new container.

  1. I issued php artisan key:generate --show, copied a key. Pasted to .env file as APP_KEY. Restart container. No success, still error 500.
  2. I used portainer to recreate a container with new env to APP_KEY=my-key, so I have running container with the value in it's environment, AND the same key in .env file. Restarted container. No success, still error 500.

The explained steps from the posts above looks very clear and easy, but it simply does not do a trick for me. What I am missing?

My .env file

# Used for encryption where needed, if a key is not generated run: php artisan key:generate
APP_KEY="base64:YWT8xVsZ9hBDNyc9VGtZ/dAmIP575g+nsjAEJ8OwP+E"
docker inspect speedtest-tracker  | grep APP_KEY
                "APP_KEY=base64:YWT8xVsZ9hBDNyc9VGtZ/dAmIP575g+nsjAEJ8OwP+E"

Thank you

See above

@alexjustesen
Copy link
Owner

Are you getting the same error after setting the key?

@b2eboy
Copy link
Author

b2eboy commented Oct 5, 2023

Are you getting the same error after setting the key?

Yes, that's what I described above. Or at least I hope I understand the same for "setting the key".
What you exactly mean by setting the key? To store the key in .env file? Yes, I did it.
Please, look at the block of code I inserted in my previous post. Thank you.

@RobertD502
Copy link

RobertD502 commented Oct 5, 2023

Are you getting the same error after setting the key?

Yes, that's what I described above. Or at least I hope I understand the same for "setting the key".

What you exactly mean by setting the key? To store the key in .env file? Yes, I did it.

Please, look at the block of code I inserted in my previous post. Thank you.

As Alex noted before, you may need to delete the .env file that is located within the Speedtest config directory - not the .env file you're pointing docker to use (be sure to copy the .env file from the speedtest config directory over to another location before as you may lose, if you defined any, custom defined settings when the .env file is recreated). In docker, set the APP_KEY environment variable as described before and recreate the container. This time a new .env file will be created in the speedtest config directory. If you had some manual settings in the old .env file that you want to transfer over, do so and then restart the container again.

I suspect the container wasn't actually being recreated (even though you mention the APP_KEY is listed inside of the Speedtest .env file) and as a result the Key isn't being used.

Edit: did your steps involve those seen here under the Editing a running container section? Just want to confirm the container is being recreated and the old one replaced after you edited the container's settings (i.e., added the APP_KEY env variable).

@b2eboy
Copy link
Author

b2eboy commented Oct 5, 2023

I am not sure if I am clear in describing, because you are pointing me again to the steps I have really done and I read the posts carefully.

So let's be very detailed now and start from scratch step-by step:

Remove container and image:

root@nuc7:~# docker stop speedtest-tracker
speedtest-tracker
root@nuc7:~# docker rm speedtest-tracker
speedtest-tracker
root@nuc7:~# docker rmi ghcr.io/alexjustesen/speedtest-tracker
( ...deleted.... )

The MariaDB database tables are dropped:

DROP TABLE `bck_users`, `cache`, `cache_locks`, `failed_jobs`, `jobs`, `migrations`, `notifications`, `password_reset_tokens`, `personal_access_tokens`, `results`, `sessions`, `settings`, `users`; 

There are no files in the data directories mounted to future new container

root@nuc7:~# find /docker/data/speedtest_tracker
/docker/data/speedtest_tracker
/docker/data/speedtest_tracker/config
/docker/data/speedtest_tracker/directory
/docker/data/speedtest_tracker/directory/web

Starting from scratch:

docker run -d --name speedtest-tracker --restart unless-stopped \
    -p 8765:80 -p 8766:443 -e PUID=2511 -e PGID=2511 -e TZ=Europe/Prague \
    -e DB_CONNECTION=mysql -e DB_HOST=10.0.3.1 -e DB_PORT=3306 \
    -e DB_DATABASE=speedtest -e DB_USERNAME=speedtest -e DB_PASSWORD=XXXXXXXX \
    -v /etc/localtime:/etc/localtime:ro \
    -v /docker/data/speedtest_tracker/config:/config \
    -v /docker/data/speedtest_tracker/directory/web:/etc/ssl/web \
    ghcr.io/alexjustesen/speedtest-tracker:latest

(...shortened...)
Status: Downloaded newer image for ghcr.io/alexjustesen/speedtest-tracker:latest
7b154dcee09c32c2edc4e3eb77a5c790054a9e48cd987e8f8f5d88ae1c458d17

Container deployed...

root@nuc7:~# docker ps --latest
CONTAINER ID   IMAGE                                           COMMAND   CREATED          STATUS          PORTS                                                   NAMES
7b154dcee09c   ghcr.io/alexjustesen/speedtest-tracker:latest   "/init"   27 seconds ago   Up 26 seconds   9000/tcp, 0.0.0.0:8765->80/tcp, 0.0.0.0:8766->443/tcp   speedtest-tracker

And running fine...

root@nuc7:~# docker logs speedtest-tracker
(...shortened...)
💰  Building the cache...
✅  Cache set.

🚛  Migrating the database...
✅  Database migrated.

✅  All set, Speedtest Tracker started.

[05-Oct-2023 12:28:04] NOTICE: fpm is running, pid 129
[05-Oct-2023 12:28:04] NOTICE: ready to handle connections
[05-Oct-2023 12:28:04] NOTICE: systemd monitor interval set to 10000ms

Container deployed new files in it's config directory:

root@nuc7:~# find /docker/data/speedtest_tracker/config/
/docker/data/speedtest_tracker/
/docker/data/speedtest_tracker/config
/docker/data/speedtest_tracker/config/.env

We can check the same from inside the container (it's the same file)

root@nuc7:~# docker exec -t speedtest-tracker find /config
/config
/config/.env

No APP_KEY variable in the /config/.env file for now

root@nuc7:~# grep APP_KEY /docker/data/speedtest_tracker/config/.env
APP_KEY=

root@nuc7:~# docker exec -t speedtest-tracker grep APP_KEY /config/.env
APP_KEY=

No APP_KEY variable in the deployed environment for now

root@nuc7:~# docker inspect speedtest-tracker | grep APP_KEY
(...no output...)

So, let's make a fix based on what's written above.
First, generate the base64 key

root@nuc7:~# docker exec -t speedtest-tracker php artisan key:generate --show
base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s=

Then delete the .env file:

root@nuc7:~# docker exec -t speedtest-tracker rm /config/.env
root@nuc7:~#

Was the file deleted? Yes.

root@nuc7:~# docker exec -t speedtest-tracker ls -la /config/
total 8
drwxr-xr-x 2 webuser webgroup 4096 Oct  5 12:45 .
drwxr-xr-x 1 root    root     4096 Oct  5 12:28 ..

Method using portainer
Containers -> Speedtest Tracker -> Duplicate/Edit -> click to tab Env
-> click Add an environment variable

name: APP_KEY
value: base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s=
(Note: including the padding equal sign)
Click to Deploy the container:
A container with the same name already exists. Portainer can automatically remove it and re-create one. Do you want to replace it?
Yes->Replace
Success message

Was the container recreated and restarted? Yes. There is new container ID and Uptime was reset.

root@nuc7:~# docker ps --latest
CONTAINER ID   IMAGE                                           COMMAND   CREATED         STATUS         PORTS                                                   NAMES
d3826f995e29   ghcr.io/alexjustesen/speedtest-tracker:latest   "/init"   2 minutes ago   Up 2 minutes   9000/tcp, 0.0.0.0:8765->80/tcp, 0.0.0.0:8766->443/tcp   speedtest-tracker

Checking environment after modification:
There is APP_KEY in the environment loaded:

root@nuc7:~# docker inspect speedtest-tracker | grep APP_KEY
                "APP_KEY=base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s="

The .env file was re-created, but no APP_KEY value was added:

root@nuc7:~# docker exec -t speedtest-tracker grep APP_KEY /config/.env
APP_KEY=

(Intermediate step: test for Error 500 -> Yes, still there.)

Manually adding base64 key to the file:
vim /docker/data/speedtest_tracker/config/.env

It was added:

root@nuc7:~# docker exec -t speedtest-tracker grep APP_KEY /config/.env
APP_KEY="base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s="

Restart container

root@nuc7:~# docker restart speedtest-tracker
speedtest-tracker

Doublecheck again of all mentioned:

root@nuc7:~# docker exec -t speedtest-tracker grep APP_KEY /config/.env
APP_KEY="base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s="

root@nuc7:~# docker inspect speedtest-tracker | grep APP_KEY
                "APP_KEY=base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s="

Checking the web of the Speed Tracker. Heading to Settings->General.

And AGAIN, Error 500 is there.

root@nuc7:~# docker logs speedtest-tracker
(...shortened...)
#140 {main}
\\n[previous exception] Over 9 levels deep, aborting normalization"}
10.0.2.30 - - [05/Oct/2023:13:23:32 +0200] "GET /admin/general-page HTTP/1.1" 500 6622 "http://10.0.3.1:8765/admin" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/118.0"

So, now tell me, is there really anything I missed based on already written?

@RobertD502
Copy link

Thanks for the detailed response @b2eboy. From what I can tell, you may not be entering the APP_KEY env variable in portainer with double quotes. For example, your docker inspect speedtest-tracker | grep APP_KEY command returned "APP_KEY=base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s=". What it should return is:

robert@ubuntu-server:~$ docker inspect speedtest | grep APP_KEY
                "APP_KEY=\"base64:zR1R6XQh1yQufxQWuNVINLnJWOiI308HShuB4/Yb6SE=\"",

Did you add quotation marks around the APP_KEY value when adding the env variable via portainer?

@b2eboy
Copy link
Author

b2eboy commented Oct 5, 2023

I would be so happy if I can tell you this was the issue, but it did not help :-(
Still error 500.

Current state:

root@nuc7:~# docker exec -t speedtest-tracker rm /config/.env
<now update variable in portainer, recreate>
root@nuc7:~# docker restart speedtest-tracker
root@nuc7:~# docker exec -t speedtest-tracker grep APP_KEY /config/.env
APP_KEY="base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s="
root@nuc7:~# docker inspect speedtest-tracker | grep APP_KEY
                "APP_KEY=\"base64:IQhpSDAvXlZcT1d8YzUPNZ+TBo0NQ6f+lytrnAOqv2s=\""

@RobertD502
Copy link

Mind sharing the full log of what you're getting now?

@alexjustesen alexjustesen added the 🐛 bug Something isn't working label Oct 5, 2023
@alexjustesen alexjustesen self-assigned this Oct 5, 2023
@alexjustesen alexjustesen reopened this Oct 5, 2023
@masterwishx
Copy link

same issue on Unraid

Added APP_KEY from env file to Docker build in UnraId ,Fixed the error

@masterwishx
Copy link

Email and telegram from .env Also not Working

@gramilla
Copy link

gramilla commented Oct 6, 2023

this help me
php artisan key:generate --show
add to docker-compose

  • APP_KEY ="base64:WpAZWf..."
    restart container

@hizenburgxb
Copy link

Awesome @RobertD502 the API KEY entry fixed mime. Predicate you man! Kudos to you!

@b2eboy
Copy link
Author

b2eboy commented Oct 8, 2023

Mind sharing the full log of what you're getting now?

speedtest-docker-logs.log

I hope this log is what you requested...

@RobertD502
Copy link

Mind sharing the full log of what you're getting now?

speedtest-docker-logs.log

I hope this log is what you requested...

Yes, thanks. I can see that the 500 error in your log isn't followed by any indication that this is related to the App key. Maybe tail your log as you try to access the page multiple times to see if anything useful pops up in the log.

@b2eboy
Copy link
Author

b2eboy commented Oct 9, 2023

I did few refreshes of the page. The log is big.
LOG: speedtest-docker-logs.log

I see there is one repetitive suspect line that I did not find before.

[previous exception] [object] (Illuminate\\View\\ViewException(code: 0): cURL error 28: Resolving timed out after 10000 milliseconds (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) for https://www.speedtest.net/api/js/servers?engine=js&https_functional=1&limit=20 (View: /var/www/html/vendor/filament/forms/resources/views/components/select.blade.php) (View: /var/www/html/vendor/filament/forms/resources/views/components/select.blade.php) (View: /var/www/html/vendor/filament/forms/resources/views/components/select.blade.php) (View: /var/www/html/vendor/filament/forms/resources/views/components/select.blade.php) (View: /var/www/html/vendor/filament/forms/resources/views/components/select.blade.php) (View: /var/www/html/vendor/filament/forms/resources/views/components/select.blade.php) at /var/www/html/vendor/laravel/framework/src/Illuminate/Http/Client/PendingRequest.php:924)

@b2eboy
Copy link
Author

b2eboy commented Oct 9, 2023

Wow. I've probably found the problem and fixed. The log message helped me.
The container had DNS resolving issue.
When I recreate the container adding --dns=1.1.1.1 --dns=8.8.8.8 --dns=1.0.0.1 --dns=8.8.4.4 to the docker run command, the Error 500 is gone!

Thank you anyway for the troubleshooting!

@ks2018ks
Copy link

Would you mind explaining what is meant by this:

when inside the container run the following command php artisan key:generate --show

I'm in synology NAS via SSH (sudo su) in the folder /docker.
I enter docker exec -ti speedtest-tracker /bin/bash.
Then I enter php artisan key:generate --show but get Could not open input file: artisan.

@hoorna
Copy link

hoorna commented Oct 13, 2023

@ks2018ks, you have to give the command inside the container. To do that you can open the Docker app (or the Container Manager app if you have DSM 7.0 or above) in Synology DSM, then select the running speedtest-tracker docker container and open the terminal in that container (somewhere in the Docker app menu you will find an Open Terminal knob).

Succes!

@ks2018ks
Copy link

...in Synology DSM, then select the running speedtest-tracker docker container and open the terminal in that container (somewhere in the Docker app menu you will find an Open Terminal knob).

Many thanks (It's under the Action menu)

image

@christoney
Copy link

I too am running Synology NAS, Portainer, etc. I also was experiencing some trouble with adding to the ENV with Portainer. Once I did the work from the Synology container manager, it worked just fine. Not sure where the block was, but completing the task from RobertD502 in the Synology container manager worked the first try. Hope this post saves hours of trying and giving up multiple times. Cheers!

@vstrong-info
Copy link

@christoney I also had the same experience with Portainer and had to add ENV variable via Synology Container Manager.

@gVes
Copy link

gVes commented Oct 23, 2023

To get around this, run docker exec -ti name_of_your_container /bin/bash, when inside the container run the following command php artisan key:generate --show copy the output as you'll need to set the APP_KEY environment variable to it (either in your compose file or within your docker run command).

Example: APP_KEY="base64:23423h4v23hg4v2j34bvc1y231v2y3"

This did not work for me. Restarted the container with the docker compose file containing the APP_KEY variable, but still having "Server Error" 500.

Not sure what else to do?

@alexjustesen
Copy link
Owner

alexjustesen commented Oct 23, 2023

This did not work for me. Restarted the container with the docker compose file containing the APP_KEY variable, but still having "Server Error" 500.

Not sure what else to do?

Follow the steps in the docs for exposing the error logs as "500 server error" is just a generic server error. Feel free to open a new issue once you have the logs.

OP's issue was resolved so I'm closing this issue.

@bdub-jville
Copy link

To get around this, run docker exec -ti name_of_your_container /bin/bash, when inside the container run the following command php artisan key:generate --show copy the output as you'll need to set the APP_KEY environment variable to it (either in your compose file or within your docker run command).

Example: APP_KEY="base64:23423h4v23hg4v2j34bvc1y231v2y3"

Thanks, my existing install broke with the 500 error until I generated and added this.

@L0ck3dFR
Copy link

Hi, just created an account to thanks you for this thread, had to jump from 0.11.16 to 0.14.4 and was confronted with error 500.
perfect workaround and explanations for a novice like me. Thanks @RobertD502

@socekin
Copy link

socekin commented Apr 21, 2024

@ks2018ks, you have to give the command inside the container. To do that you can open the Docker app (or the Container Manager app if you have DSM 7.0 or above) in Synology DSM, then select the running speedtest-tracker docker container and open the terminal in that container (somewhere in the Docker app menu you will find an Open Terminal knob).,你必须在容器内发出命令。为此,您可以在 Synology DSM 中打开 Docker 应用程序(如果您有 DSM 7.0 或更高版本,则打开 Container Manager 应用程序),然后选择正在运行的 speedtest-tracker docker 容器并打开该容器中的终端(位于 Docker 应用程序菜单中的某个位置)您会发现一个开放终端旋钮)。

Succes! 成功!

I entered the Docker internal dash and outputted "php artisan key:generate", but it still prompts "Could not open input file: artisan".

@fopoku2k2
Copy link

php artisan key:generate --show

newbie here. can you guide me on how to actually do all this??

@fopoku2k2
Copy link

@christoney I also had the same experience with Portainer and had to add ENV variable via Synology Container Manager.

how did you get the variable??

@christoney
Copy link

@fopoku2k2 read the posts/comments previous.

@fopoku2k2
Copy link

@fopoku2k2 read the posts/comments previous.

I’ve read it but unfortunately I don’t understand it that’s why I asked for your help

@christoney
Copy link

christoney commented Apr 28, 2024 via email

@masterwishx
Copy link

@christoney I also had the same experience with Portainer and had to add ENV variable via Synology Container Manager.

how did you get the variable??

You can find in logs , this command run in first time container start or just run the command from console to get the key then add it to vars

@ArthurMitchell42
Copy link

Hi, when I enter php artisan key:generate --show all I get is "Could not open input file: artisan"?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working
Projects
None yet
Development

No branches or pull requests