You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If the /etc/timezone is a directory, then prefect crashes.
Yes, that should be a file (link) instead of a folder, but some distribution and package maintainers like to create it on every update. I'm using a few ArchLinux machines, where this happens after every update.
This is caused by a bug in pendulum which is fixed by me already. Even if the fix is already merged, I don't know when it will be released, so this is the reason for this issue. I hope for the best because it's also affecting airflow.
Expected Behavior
...
Reproduction
safely move your /etc/timezone to a backup place to easy to restore later sudo mv /etc/timezone /etc/timezone.backup if exists
create /etc/timezone as directory sudo mkdir /etc/timezone
do something, like start an agent prefect agent local start --name "Temp agent"
prefect agent local start --name "Temp agent"
Traceback (most recent call last):
File "/home/beci/.local/bin/prefect", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3.10/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3.10/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.10/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3.10/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3.10/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/beci/.local/lib/python3.10/site-packages/prefect/cli/agent.py", line 182, in start
start_agent(LocalAgent, import_paths=list(import_paths), **kwargs)
File "/home/beci/.local/lib/python3.10/site-packages/prefect/cli/agent.py", line 139, in start_agent
agent = agent_cls(labels=labels, env_vars=env_vars, **kwargs)
File "/home/beci/.local/lib/python3.10/site-packages/prefect/agent/local/agent.py", line 77, in __init__
super().__init__(
File "/home/beci/.local/lib/python3.10/site-packages/prefect/agent/agent.py", line 134, in __init__
self.client = Client(api_server=config.cloud.api, api_token=token)
File "/home/beci/.local/lib/python3.10/site-packages/prefect/client/client.py", line 122, in __init__
self._access_token_expires_at = pendulum.now()
File "/home/beci/.local/lib/python3.10/site-packages/pendulum/__init__.py", line 211, in now
dt = _datetime.datetime.now(local_timezone())
File "/home/beci/.local/lib/python3.10/site-packages/pendulum/tz/__init__.py", line 60, in local_timezone
return get_local_timezone()
File "/home/beci/.local/lib/python3.10/site-packages/pendulum/tz/local_timezone.py", line 35, in get_local_timezone
tz = _get_system_timezone()
File "/home/beci/.local/lib/python3.10/site-packages/pendulum/tz/local_timezone.py", line 63, in _get_system_timezone
return _get_unix_timezone()
File "/home/beci/.local/lib/python3.10/site-packages/pendulum/tz/local_timezone.py", line 165, in _get_unix_timezone
with open(tzpath, "rb") as tzfile:
IsADirectoryError: [Errno 21] Is a directory: '/etc/timezone'
Hey @beci — I'm not sure what we could do to resolve this for you since this is an upstream bug in pendulum. You can install pendulum from git instead of PyPi so you don't have to wait for a release e.g.
I'm afraid you can't do too much until that pendulum fix is released. I opened this issue to notify you about the problem and save some time for the ones who experience the same problem.
Thanks! I'm sure it'll be helpful. Since we can't do anything, I'm going to close the issue. Changing your pendulum installation if you're affected should be a viable workaround.
Description
If the
/etc/timezone
is a directory, then prefect crashes.Yes, that should be a file (link) instead of a folder, but some distribution and package maintainers like to create it on every update. I'm using a few ArchLinux machines, where this happens after every update.
This is caused by a bug in pendulum which is fixed by me already. Even if the fix is already merged, I don't know when it will be released, so this is the reason for this issue. I hope for the best because it's also affecting airflow.
Expected Behavior
...
Reproduction
sudo mv /etc/timezone /etc/timezone.backup
if exists/etc/timezone
as directorysudo mkdir /etc/timezone
prefect agent local start --name "Temp agent"
Environment
prefect diagnostics
{
"config_overrides": {},
"env_vars": [],
"system_information": {
"platform": "Linux-5.16.0-arch1-1-x86_64-with-glibc2.33",
"prefect_backend": "server",
"prefect_version": "0.15.11",
"python_version": "3.10.1"
}
}
The text was updated successfully, but these errors were encountered: