https://prefect.io logo
r

Raúl Mansilla

12/23/2021, 2:27 PM
Hello all, I´m facing an issue that I´m not able to fix easily…`RuntimeError: Unable to find any timezone configuration`
a

Anna Geller

12/23/2021, 2:29 PM
I believe you should be able to set your timezone the same way in Server:
👍 1
r

Raúl Mansilla

12/23/2021, 2:30 PM
I´m assuming it is happening inside the dask cluster. Dask scheduler and worker are running in alpine docker containers that have tzdata installed. I´ve checked in all the ec2 and containers and all of them are showing date accordingly. I´m not sure what else I can do for fixing this.
a

Anna Geller

12/23/2021, 2:31 PM
I think as long as you set it in the UI, this should adjust your timezone in the backend. LMK if that’s not the case
r

Raúl Mansilla

12/23/2021, 2:33 PM
I think I can´t in my prefect server ui
k

Kevin Kho

12/23/2021, 2:34 PM
I have encountered this for non-Prefect related stuff. I don’t know when it happens but it can be fixed by adding the TZ env variable globally in the container. Or you can do it through a Python script:
Copy code
os.environ['TZ'] = 'Europe/London'
Link
👍 2
r

Raúl Mansilla

12/23/2021, 2:34 PM
mmm let me check that out!
k

Kevin Kho

12/23/2021, 2:35 PM
Basically all of the time-based libraries will look for the default timezone of the system and in this case they are unable to
You can install tzdata also like mentioned
r

Raúl Mansilla

12/23/2021, 2:37 PM
yep, it is already installed
I´m going to try to set it during container creation
just by doing this inside worker container fix the issue ->
cp /usr/share/zoneinfo/UTC /etc/localtime && echo UTC > /etc/timezone
k

Kevin Kho

12/23/2021, 2:53 PM
That would be nice to comment in this issue. Do you want me to?
r

Raúl Mansilla

12/23/2021, 2:54 PM
this is only for alpine based containers, for container should be ->
Copy code
ENV TZ UTC
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
I can do it! no problem
k

Kevin Kho

12/23/2021, 2:54 PM
Thank you!
r

Raúl Mansilla

12/23/2021, 2:58 PM
Thanks to you too!
2 Views