henrywhitaker3 / Speedtest-Tracker

Continuously track your internet speed
GNU General Public License v3.0
1.49k stars 122 forks source link

Sometimes works, sometimes doesn't. "Could not retrieve or read configuration" [BUG] #1119

Open mptpro opened 1 year ago

mptpro commented 1 year ago

Describe the bug Sometimes works, sometimes doesn't. See screenshot.

I get the error "Could not retrieve or read configuration"

I'm running STT in a Docker container, on a Pop_OS machine. Laravel v9.52.4 PHP v8.1.16 Filament v2.17.16 Speedtest Tracker v0.11.11

I've search for other similar errors but none that seem to solve my problem.

ksnip_20230318-210934 ksnip_20230318-210918

BrianLakstins commented 1 year ago

I just started getting this today using the docker container:

[cont-init.d] 50-speedtest: executing... [2023-06-21 23:09:04.851] [error] Configuration - SSL connect error (UnknownException) [2023-06-21 23:09:04.851] [error] Configuration - Cannot retrieve configuration document (0) [2023-06-21 23:09:04.851] [error] ConfigurationError - Could not retrieve or read configuration (Configuration) [2023-06-21 23:09:04.852] [error] ConfigurationError - Could not retrieve or read configuration (Configuration) [error] Configuration - Could not retrieve or read configuration (ConfigurationError) Copying latest site files to config

mattdayinbound commented 1 year ago

I just started getting this today using the docker container:

[cont-init.d] 50-speedtest: executing... [2023-06-21 23:09:04.851] [error] Configuration - SSL connect error (UnknownException) [2023-06-21 23:09:04.851] [error] Configuration - Cannot retrieve configuration document (0) [2023-06-21 23:09:04.851] [error] ConfigurationError - Could not retrieve or read configuration (Configuration) [2023-06-21 23:09:04.852] [error] ConfigurationError - Could not retrieve or read configuration (Configuration) [error] Configuration - Could not retrieve or read configuration (ConfigurationError) Copying latest site files to config

this is the same exact thing I'm seeing in my logs as well. The problem started happening about 4.5 hours ago. I'm going crazy making sure my container was correctly setup since this error came out of no where lol I wonder if more users are experiencing the same thing.

radbasa commented 1 year ago

Seeing the same error now

[2023-06-22 16:28:02.200] [error] Configuration - SSL connect error (UnknownException)
[2023-06-22 16:28:02.201] [error] Configuration - Cannot retrieve configuration document (0)
[2023-06-22 16:28:02.201] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[2023-06-22 16:28:02.201] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
{"type":"log","timestamp":"2023-06-22T08:28:02Z","message":"Configuration - Could not retrieve or read configuration (ConfigurationError)","level":"error"}
BrianLakstins commented 1 year ago

The error seems to be caused by the Ookla speedtest binary. This is what I get when I run it directly, just trying to get the version.

root@841d6a3ff8d6:/config/www/app/Bin# ./speedtest -v
[2023-06-22 12:10:08.833] [warning] Failure during HTTP request (effective url: https://cli.speedtest.net/api/cli/config?deviceId=6b5cea4a1ee63b711507aa94b5d350a201d3aa674af43792f16f0c6901ba53dc&hid=%255BV%2504S%2504SW%2503W%2509%250FZ&sid=c9c3a6722fbce8a9eb51e1785a49978ca6f279456d0be1fb216c3eadf7977e7b&uname=Linux%205.19.0-45-generic%20%2346~22.04.1-Ubuntu%20SMP%20PREEMPT_DYNAMIC%20Wed%20Jun%207%2015%3A06%3A04%20UTC%2020%20x86_64)
[2023-06-22 12:10:08.833] [warning] UnknownException
[2023-06-22 12:10:08.833] [warning] SSL connect error
[2023-06-22 12:10:08.833] [error] Configuration - SSL connect error (UnknownException)
[2023-06-22 12:10:08.833] [error] Configuration - Cannot retrieve configuration document (0)
[2023-06-22 12:10:08.833] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[2023-06-22 12:10:08.833] [error] ConfigurationError - Could not retrieve or read configuration (Configuration)
[error] Configuration - Could not retrieve or read configuration (ConfigurationError)
root@841d6a3ff8d6:/config/www/app/Bin# 

I downloaded the latest binary and tried it in an Ubuntu 22.04 WSL command line and it worked to get the result, but had an error in it also:

[error] Error: [0] Protocol error: Did not receive HELLO; input:SFRUUC8xLjEgNDAwIEJhZCBSZXF1ZXN0DQpTZXJ2ZXI6IGNsb3VkZmxhcmUNCkRhdGU6IFRodSwgMjIgSnVuIDIwMjMgMTI6MTY6MTIgR01UDQpDb250ZW50LVR5cGU6IHRleHQvaHRtbA0KQ29udGVudC1MZW5ndGg6IDE1NQ0KQ29ubmVjdGlvbjogY2xvc2UNCkNGLVJBWTogLQ0KDQo8aHRtbD4NCjxoZWFkPjx0aXRsZT40MDAgQmFkIFJlcXVlc3Q8L3RpdGxlPjwvaGVhZD4NCjxib2R5Pg0KPGNlbnRlcj48aDE+NDAwIEJhZCBSZXF1ZXN0PC9oMT48L2NlbnRlcj4NCjxocj48Y2VudGVyPmNsb3VkZmxhcmU8L2NlbnRlcj4NCjwvYm9keT4NCjwvaHRtbD4NCg== result:0VQbEuWnX+Xj+v0XEyUuAF7JmuY6gS9JPHb6SoAacq9KnQDgtXY0vkE69l2xqBygrcuwaDCO35Rk6Mq42mEXtOoLg1weMpk9F5mChZlppi+k0CRDiXH3iHu8Gcm2szkq+vv26RPDTDGV+kG2f8B0kjvS/ohoVMiSzNzDlTyPl2kSuikv+6MzuOShGN/Bg25A0N9WvBWU1e2JEhGfe83yBrBL9+6Xh7CVHg4avOZShE3YZoTaJc1oGY0tr/W8EyaEb0ip3yy5zbU8B5QlnmHfhYs5r67XGMfcQRMY7SCUljHXyR0NLPkD0OHBC994zu32UP/Uleu363TE16ZA8fmxJfeaSRLZe0I2AqLXGT6wFppkHVx7001eT9BndQiOT0DCIDGKar12k+XQsrI= key:GNAPAZJbZUuZT05v72qt+470fkOFtdon8V3AGTNlUUw=

At the least, it seems that the docker image needs to be rebuilt with the latest speedtest command line tool from Ookla.

BrianLakstins commented 1 year ago

The speedtest executable is newer than the image.

root@708f447c6416:/config/www/app/Bin# ls -al
total 1371
drwxrwxr-x  2 abc abc       4 Nov 20  2022 .
drwxrwxr-x 21 abc abc      24 Nov 20  2022 ..
-rw-rw-r--  1 abc abc       9 Jun 22 12:40 .gitignore
-rwxrwxr-x  1 abc abc 2244696 Nov 20  2022 speedtest
root@708f447c6416:/config/www/app/Bin# 

I think it must get pulled as part of the initialization process.

agneevX commented 1 year ago

Could be that the version of speedtest that this project ships has been EOL'd by Ookla.

agneevX commented 1 year ago

I already have speedtest installed on the host, so I copied the binary over to the config folder and bind mapped it:

...
    volumes:
      - /opt/appdata/speedtest-tracker/app:/config/www/app/Bin

And it works:

Screenshot

Not a good solution, but workarounds are common for dead projects.

DWiechert commented 1 year ago

@agneevX - Where did you download the binary from?

agneevX commented 1 year ago

You can follow the instructions on Ookla's speedtest-cli or use your downloader of choice to download it from: https://packagecloud.io/ookla/speedtest-cli/

mlapaglia commented 1 year ago

having the same issue, anything i can do to help?

BrianLakstins commented 1 year ago

I think I new docker image will be needed. I found the code for downloading the speedtest executable in the file

/etc/cont-init.d/50-speedtest

# Do Ookla stuff
if [ -z ${OOKLA_EULA_GDPR+x} ]; then
    eulaError
else
    if [ $OOKLA_EULA_GDPR != "true" ]; then
        eulaError
    fi

    if [ ! -f /config/www/app/Bin/speedtest ]; then
        echo "Ookla GDPR and EULA accepted. Downloading Speedtest CLI."
        cd /tmp
        wget https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-$arch-linux.tgz -O speedtest.tgz > /dev/null
        tar zxvf speedtest.tgz > /dev/null
        cp speedtest /site/app/Bin/

        HOME=/config && timeout 5s s6-setuidgid abc /site/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
        HOME=/root
    else 
        HOME=/config && timeout 5s s6-setuidgid abc /config/www/app/Bin/speedtest --accept-license --accept-gdpr > /dev/null
        HOME=/root
    fi
fi

The file is part of the docker image creation process. I think a new image can be created based on the current one, but with an updated 50-speedtest file.

I think the code just needs to be revised to be a newer version. Maybe use an environment variable to configure the version, so it can be specified when the docker container is instantiated.

slycat34 commented 1 year ago

From @agneevX

I already have speedtest installed on the host, so I copied the binary over to the config folder and bind mapped it:

...
    volumes:
      - /opt/appdata/speedtest-tracker/app:/config/www/app/Bin

On debian install I changed the volume mount to -/usr/bin/speedtest:/config/www/app/Bin/speedtest:ro And am back up and running. ':ro' just helps ensure the container does not try to mess with the file & now any update to ookla gets seen by container

gti4life commented 1 year ago

Any workarounds for TrueNAS-SCALE-22.12.1 ?

Hilljack4n6 commented 1 year ago

Running this Docker on unRAID and mine began having this issue on 6/21/23. I’ll try working on it this weekend with the advice from @agneevX and post an update.

Byrnesdigital commented 1 year ago

Not a good solution, but workarounds are common for dead projects.

There's a fork that's actively maintained. Hopefully exporting my data from this and uploading it there will be a simple process.

alexjustesen/speedtest-tracker

agneevX commented 1 year ago

I tried that a while back and it's extremely unstable to the point of it being unusable.

vdisp commented 1 year ago

Running this Docker on unRAID and mine began having this issue on 6/21/23. I’ll try working on it this weekend with the advice from @agneevX and post an update.

Same here regarding unRAID 2023-06-24_16-20

henrywhitaker3 commented 1 year ago

Could you guys try image henrywhitaker3/speedtest-tracker:v1.12.3-dev for me please?

agneevX commented 1 year ago

Seems to be amd64 only.

ayvanovich commented 1 year ago

I pulled the new image it worked

henrywhitaker3 commented 1 year ago

@agneevX I merged this, so the latest dev tag of the image should work

agneevX commented 1 year ago

Thanks!

https://github.com/henrywhitaker3/Speedtest-Tracker/blob/14fd1b688ea417e006270b1eebe266e2506c3170/docker/conf/etc/cont-init.d/50-speedtest#L23

It looks like the speedtest command is still run from the binary at /config/www/app/Bin/speedtest?

vdisp commented 1 year ago

'Could you guys try image henrywhitaker3/speedtest-tracker:v1.12.3-dev for me please?'

In unRAID, updated, the repository to 'henrywhitaker3/speedtest-tracker:v1.12.3-dev':

`Command execution docker run -d --name='speedtest-tracker' --net='br0' --ip='192.168.1.1' -e TZ="America/Detroit" -e HOST_OS="Unraid" -e HOST_HOSTNAME="DISK" -e HOST_CONTAINERNAME="speedtest-tracker" -e 'TCP_PORT_80'='' -e 'SLACK_WEBHOOK'='' -e 'OOKLA_EULA_GDPR'='true' -l net.unraid.docker.managed=dockerman -l net.unraid.docker.webui='http://[IP]:[PORT:80]/' -l net.unraid.docker.icon='https://raw.githubusercontent.com/selfhosters/unRAID-CA-templates/master/templates/img/speedtest-tracker.png' -v '/mnt/user/appdata/speedtest-tracker':'/config':'rw' --restart unless-stopped 'henrywhitaker3/speedtest-tracker:v1.12.3-dev'

ed7fafffd7207c91c2d4371978f46e6ff8494

The command finished successfully!`

There were errors in the log file:

`Package fruitcake/laravel-cors is abandoned, you should avoid using it. No replacement was suggested. Package influxdb/influxdb-php is abandoned, you should avoid using it. No replacement was suggested. Package swiftmailer/swiftmailer is abandoned, you should avoid using it. Use symfony/mailer instead. Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested. Generating optimized autoload files

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi 100 packages you are using are looking for funding. Use the composer fund command to find out more! Discovered Package: barryvdh/laravel-ide-helper Discovered Package: facade/ignition Discovered Package: fideloper/proxy Discovered Package: fruitcake/laravel-cors Discovered Package: henrywhitaker3/laravel-actions Discovered Package: laravel-notification-channels/telegram Discovered Package: laravel/slack-notification-channel Discovered Package: laravel/tinker Discovered Package: laravel/ui Discovered Package: nesbot/carbon Discovered Package: nunomaduro/collision Discovered Package: tymon/jwt-auth Package manifest generated successfully. Running database migrations Nothing to migrate. App key exists JWT secret exists Slack webhook is unset Telegram chat id and bot token unset Base path is unset AUTH variable not set. Disabling authentication Disabling authentication Clearing old jobs from queue Setting resolver to 127.0.0.11 Setting worker_processes to 4 using keys found in /config/keys [custom-init] No custom files found, skipping... [ls.io-init] done. PHP Fatal error: Uncaught Error: Call to undefined function NunoMaduro\Collision\token_get_all() in /config/www/vendor/nunomaduro/collision/src/Highlighter.php:138 Stack trace:

0 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(128): NunoMaduro\Collision\Highlighter->tokenize()

1 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(110): NunoMaduro\Collision\Highlighter->getHighlightedLines()

2 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(99): NunoMaduro\Collision\Highlighter->getCodeSnippet()

3 /config/www/vendor/nunomaduro/collision/src/Writer.php(280): NunoMaduro\Collision\Highlighter->highlight()

4 /config/www/vendor/nunomaduro/collision/src/Writer.php(120): NunoMaduro\Collision\Writer->renderEditor()

5 /config/www/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()

6 /config/www/vendor/filp/whoops/src/Whoops/Run.php(398): NunoMaduro\Collision\Handler->handle()

7 [internal function]: Whoops\Run->handleException()

8 {main}

thrown in /config/www/vendor/nunomaduro/collision/src/Highlighter.php on line 138 PHP Fatal error: Uncaught Error: Call to undefined function NunoMaduro\Collision\token_get_all() in /config/www/vendor/nunomaduro/collision/src/Highlighter.php:138 Stack trace:

0 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(128): NunoMaduro\Collision\Highlighter->tokenize()

1 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(110): NunoMaduro\Collision\Highlighter->getHighlightedLines()

2 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(99): NunoMaduro\Collision\Highlighter->getCodeSnippet()

3 /config/www/vendor/nunomaduro/collision/src/Writer.php(280): NunoMaduro\Collision\Highlighter->highlight()

4 /config/www/vendor/nunomaduro/collision/src/Writer.php(120): NunoMaduro\Collision\Writer->renderEditor()

5 /config/www/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()

6 /config/www/vendor/nunomaduro/collision/src/Adapters/Laravel/ExceptionHandler.php(72): NunoMaduro\Collision\Handler->handle()

7 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(185): NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler->renderForConsole()

8 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(171): Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole()

9 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(209): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()

10 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()

11 {main}

thrown in /config/www/vendor/nunomaduro/collision/src/Highlighter.php on line 138`

But does seem to be working again.

Hilljack4n6 commented 1 year ago

Could you guys try image henrywhitaker3/speedtest-tracker:v1.12.3-dev for me please?

Worked for me on unRAID. Thank you!!

BrianLakstins commented 1 year ago

Looks like it's working. Lots of error matching this showed up in my log:

PHP Fatal error:  Uncaught Error: Call to undefined function NunoMaduro\Collision\token_get_all() in /config/www/vendor/nunomaduro/collision/src/Highlighter.php:138

Stack trace:
#0 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(128): NunoMaduro\Collision\Highlighter->tokenize()
#1 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(110): NunoMaduro\Collision\Highlighter->getHighlightedLines()
#2 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(99): NunoMaduro\Collision\Highlighter->getCodeSnippet()
#3 /config/www/vendor/nunomaduro/collision/src/Writer.php(280): NunoMaduro\Collision\Highlighter->highlight()
#4 /config/www/vendor/nunomaduro/collision/src/Writer.php(120): NunoMaduro\Collision\Writer->renderEditor()
#5 /config/www/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()
#6 /config/www/vendor/nunomaduro/collision/src/Adapters/Laravel/ExceptionHandler.php(72): NunoMaduro\Collision\Handler->handle()
#7 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(185): NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler->renderForConsole()
#8 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(171): Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole()
#9 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(209): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()
#10 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#11 {main}
  thrown in /config/www/vendor/nunomaduro/collision/src/Highlighter.php on line 138
cheehoong commented 1 year ago

I running at unraid docker. speedtest is working now. But have same above error msg...

PHP Fatal error:  Uncaught Error: Call to undefined function NunoMaduro\Collision\token_get_all() in /config/www/vendor/nunomaduro/collision/src/Highlighter.php:138
Stack trace:
#0 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(128): NunoMaduro\Collision\Highlighter->tokenize()
#1 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(110): NunoMaduro\Collision\Highlighter->getHighlightedLines()
#2 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(99): NunoMaduro\Collision\Highlighter->getCodeSnippet()
#3 /config/www/vendor/nunomaduro/collision/src/Writer.php(280): NunoMaduro\Collision\Highlighter->highlight()
#4 /config/www/vendor/nunomaduro/collision/src/Writer.php(120): NunoMaduro\Collision\Writer->renderEditor()
#5 /config/www/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()
#6 /config/www/vendor/nunomaduro/collision/src/Adapters/Laravel/ExceptionHandler.php(72): NunoMaduro\Collision\Handler->handle()
#7 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(185): NunoMaduro\Collision\Adapters\Laravel\ExceptionHandler->renderForConsole()
#8 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(171): Illuminate\Foundation\Bootstrap\HandleExceptions->renderForConsole()
#9 /config/www/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(209): Illuminate\Foundation\Bootstrap\HandleExceptions->handleException()
#10 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions->handleShutdown()
#11 {main}
  thrown in /config/www/vendor/nunomaduro/collision/src/Highlighter.php on line 138
vdisp commented 1 year ago

But does seem to be working again.

UPDATE: (in unRAID) It seems to work when ran manually, but it is not running at the top of the hour as it did previously.

mrbagpipe commented 1 year ago

henrywhitaker3/speedtest-tracker:v1.12.3-dev

Same here. The tests are working but the logs show that message

[custom-init] No custom files found, skipping...
[ls.io-init] done.
PHP Fatal error:  Uncaught Error: Call to undefined function NunoMaduro\Collision\token_get_all() in /config/www/vendor/nunomaduro/collision/src/Highlighter.php:138

Stack trace:
#0 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(128): NunoMaduro\Collision\Highlighter->tokenize()
#1 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(110): NunoMaduro\Collision\Highlighter->getHighlightedLines()
#2 /config/www/vendor/nunomaduro/collision/src/Highlighter.php(99): NunoMaduro\Collision\Highlighter->getCodeSnippet()
#3 /config/www/vendor/nunomaduro/collision/src/Writer.php(280): NunoMaduro\Collision\Highlighter->highlight()
#4 /config/www/vendor/nunomaduro/collision/src/Writer.php(120): NunoMaduro\Collision\Writer->renderEditor()
#5 /config/www/vendor/nunomaduro/collision/src/Handler.php(39): NunoMaduro\Collision\Writer->write()
#6 /config/www/vendor/filp/whoops/src/Whoops/Run.php(398): NunoMaduro\Collision\Handler->handle()
#7 [internal function]: Whoops\Run->handleException()

}
  thrown in /config/www/vendor/nunomaduro/collision/src/Highlighter.php on line 138
Hilljack4n6 commented 1 year ago

But does seem to be working again.

UPDATE: (in unRAID) It seems to work when ran manually, but it is not running at the top of the hour as it did previously.

Good find. Same for me.

guyman624 commented 1 year ago

getting the same error on debian 11

my docker compose:


    container_name: speedtest
    image: henrywhitaker3/speedtest-tracker:v1.12.3-dev
    volumes:
      - /etc/speedtest-tracker:/config
    environment:
      - TZ=
      - PGID=1000
      - PUID=1000
      - OOKLA_EULA_GDPR=true
    logging:
      driver: "json-file"
      options:
        max-file: "10"
        max-size: "200k"
    restart: unless-stopped```
agneevX commented 1 year ago

We've already had four comments with the same set of logs, the dev is probably already aware, so please refrain from commenting if you do not have anything productive to add.

951ryan commented 1 year ago

QNAP user here....

Simply updating my container image to henrywhitaker3/speedtest-tracker:v1.12.3-dev got my instance back up and running again!

jacroe commented 1 year ago

Switched to the dev image. No issues/errors anymore on Synology.

gti4life commented 1 year ago

Any workarounds for TrueNAS-SCALE-22.12.1 ?

modifying the Image Tag to v1.12.3-dev fixed it TinyTake_27-06-2023-02-24-52

Thanks all

heyitsmdr commented 1 year ago

Switched to the v1.12.3-dev tag on Unraid, and that solved the problem for me.

UPDATE: The speed test runs successfully when manually ran, but the scheduled runs are not running.