-
-
Notifications
You must be signed in to change notification settings - Fork 119
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
Scheduled Speedtests will always run one hour late #194
Comments
Can you click on the There was an issue in the past with the UTC and timezone, but it has been solved. You're using latest version right? Times and speed values of speedtest-tracker and speedtest.net site should coincide: these are my latest tests, and times and values look correct. |
This is my docker-compose file: for best-practice, I always set in every compose file the version: '3.3'
services:
speedtest-tracker:
image: ghcr.io/alexjustesen/speedtest-tracker:v0.5.0
container_name: speedtest-tracker
restart: unless-stopped
ports:
- 8008:443
environment:
TZ: Europe/Rome
PUID: 1000
PGID: 1000
DB_CONNECTION: mysql
DB_HOST: mariadb.axel.dom
DB_PORT: 3306
DB_DATABASE: speedtest_tracker
DB_USERNAME: xxxxxxxxxx
DB_PASSWORD: **********
volumes:
- /etc/localtime:/etc/localtime:ro
- $PWD/config:/config
- $PWD/certs:/etc/ssl/web
networks:
- proxy This is my TZ setting in speedtest-tracker: |
What do we think about dropping the timezone in the UI for just the system timezone? Right now the two are different but they probably shouldn't be. |
Hi, Since the time within the Container is accurate I'm not sure where this can even come from. Can I somehow output the cron entry in the Container to double check? |
Just one other question Philipp: I only see one test
I perfectly agree. It's redundant, if the system TZ is correctly configured. We should modify the proposed docker-compose.yml in the docs. |
We're in the same TZ, I'm in Italy. :)
Yes, that would've been my next suggestion: find the crontab config, I guess the system crontab is used, but @alexjustesen will confirm. In that case, from shell: |
Haha yeah I know, I just wanted to replicate the exact (UI) setup of someone without problems to exclude any funky Bugs anyways :D About the Tests: |
we need to check the contents of that file. ;)
Can you change the schedule so to do tests every 1h so we can see what happens with 2-3 tests? Also, can you start a MANUAL test, so we can check the timestamp in the results list? So we're 100% sure it's a crontab issue. |
Hey,
so the content of crontab are actually as follows:
Seems to point to some kind of scheduler, unfortunately I don't know much about it so someone would need to let me know what root file to check please.
Yes, I will set that up tomorrow morning and respond back later that day.
I ran a manual test at 0:07 and the time matches in the Results page (as well as Speedtest.net) so it seems to be only when it's done automatically per schedule. |
I'm out of ideas, cron works fine here. @alexjustesen might suggest how to verify and debug the internal cron manager config. |
So the cron doesn't really care what time it is it's just told to run. Can you guys confirm what the offset of your timezone should be? There might be an issue with that. I also never set the timezone at the container level so that everything is reported in GMT and I let the UI do the offsets. |
We're both in CET timezone, that is GMT+1 now. Can't understand why I don't have this problem and he does, being in the same TZ. What issue did you find? It's working fine here. |
Not a clue tbh if you're both in the same TZ, also isn't it like 5:30am there? The hell you doing up? |
I had a bad flu...still recovering...was in bed for 2 days straight, can't sleep much... |
Well I hope you feel better man |
Yes I'm better, but the sleep cycle is messed up. :) Thanks man. |
@pchristod do you have the timezone set on your host machine? |
@alexjustesen Hi, yep Timezone is correct. Host machine is a Synology NAS using GMT+1 currently as per time.google.com A quick test can be seen in my first post where system time within the Container is also the same as reported back by a curl to Google. No idea why it's not working in my case tbh. |
Do me a favor and set your host tz back to GMT and let me know if anything changes |
Hi, After setting UTC in "General -> Timezone", all test results are shown correct. Maybe this helps a bit |
Hi, sorry for the late reply. What @bka-git suggested does work, however this is just a workaround which would've always worked I guess since it moves just the clock back by 1 hour. It's adjusting around the problem and will also come with the downsides like showing the wrong times in the GUI. |
Sounds like the simple fix is to drop the time zone as an admin panel option and to instead make this a container level environment variable |
I agree with this approach. In all my docker-compose files (I use a standard template), I always put the TZ env variable and also map this in volumes: I still can't understand why this issue doesn't apply to me, but it applies someone else in the same timezone. |
Only took at year but #929 should be merged this week to finally solve this issue 🤘 |
@alexdelprete you're UTC +1 right? So this makes sense because the scheduler isn't yet aware what your time zone is from the setting page. |
@alexjustesen so the fix is not complete yet? I read it was supposed to fix the problem and no TZ or /etc/localtime should be needed anymore. |
It's not merged yet so wouldn't be in a release yet. |
My bad. Since I upgraded to .4 I thought it was merged in that one. :) Will test it when it's merged, thanks. |
It'll probably hit a release come Wednesday or Thursday. |
@alexdelprete merged and a |
Just to confirm you pulled the latest dev tagged version, set your time zone in the UI and it's still off? Not at all what I experienced. I had a schedule set for 8pm (America/New_York) and it ran on the money. |
I noticed there's a new dev tag image available but I can't pull it, it returns an access denied error. |
Now the results' time seems to be correct. |
Is your source GHCR or Docker for the image? |
GHCR. |
Building now so you can avoid whatever caused that error: https://github.com/alexjustesen/speedtest-tracker/releases/tag/v0.14.0-beta1 |
Why don't you prepare a debug.php page in which it's shown what the app sees as time, the configured app Timezone, last result, etc.? so we can check internals, and what changes when I disable/enable /etc/localtime. |
Already planned because your deployment isn't functioning like mine so something else is effecting this. |
For those off by an hour, are you setting a time zone in your database container/instance? A comment by the author of #939 brought up that some people set the tz of the database as well. |
My DB container does have a TZ env setting but my results are accurate at the moment. |
my MariaDB instance is not a docker container, it is the central db for my entire homelab, it's a debian lxc and the OS time settings are fine. I have at least 18 services using MariaDB and I don't have any time issues. BTW: all DBs always uses UTC internally to avoid these kind of issues. And all apps should do the same. Local time is only to be managed at presentation layer. I wouldn't even bother having a TZ setting in the app, I would use the OS to set that, and just convert to UTC internally when saving data, and converting to OS timezone when presenting. And btw: the fact that when I map /etc/localtime in the container the problem is solved, it means some function in PHP/Laravel actually uses OS timezone for its things, otherwise it wouldn't have any effect. |
As of |
Describe the bug
Hi,
hope you are doing well and thank you for this project! I started to set this up yesterday on my Synology NAS to replace Speedtest Tracker (the original) however I'm currently seeing an issue with the Speedtest scheduling. If I set this up via cron expression, basically the same as with the original Speedtest Tracker I'm seeing that it will always run 1 hour late. E.g. if I set this to 3 PM it will run at 4 PM and I can't seem to figure out why, so I'm thinking this is a Bug. To reproduce and show it on a Screenshot I had picked a simple time. Maybe something to do with the set Timezone?
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Scheduled Tests should be run at the exact time I define them via cron expression
Screenshots
Logs
No logs showing the actual run of the test, Logiles have the correct timestamp. Executing into the container will show the time is correct:
Additional context
How I'm running the container:
The text was updated successfully, but these errors were encountered: