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

start cron on management startup (#14) #16

Merged
merged 2 commits into from
Jul 24, 2024
Merged

start cron on management startup (#14) #16

merged 2 commits into from
Jul 24, 2024

Conversation

tomkralidis
Copy link
Collaborator

Fixes #14

@nbuttdwd let me know if this works for you, at which point I will merge this PR and close #14. Thanks!

cc @antje-s

@tomkralidis tomkralidis requested a review from antje-s July 22, 2024 14:21
@nbuttdwd
Copy link

Hello Tom,
when the cronjob ran following error occured as output instead of creating the zip file:

Traceback (most recent call last):
File "/usr/local/bin/wis2-gdc", line 11, in
load_entry_point('wis2-gdc', 'console_scripts', 'wis2-gdc')()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 490, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2854, in load_entry_point
return ep.load()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2445, in load
return self.resolve()
File "/usr/lib/python3/dist-packages/pkg_resources/init.py", line 2451, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/app/wis2_gdc/init.py", line 24, in
from wis2_gdc.registrar import register, setup, teardown
File "/app/wis2_gdc/registrar.py", line 36, in
from wis2_gdc.backend import BACKENDS
File "/app/wis2_gdc/backend/init.py", line 23, in
from wis2_gdc.backend.ogcapi_records import OGCAPIRecordsBackend
File "/app/wis2_gdc/backend/ogcapi_records.py", line 27, in
from wis2_gdc import env
File "/app/wis2_gdc/env.py", line 66, in
raise EnvironmentError('Environment variables not set!')
OSError: Environment variables not set!

We took a look at env.py, we have checked the variables and they have been set. We added a print in the script to see which variables are not set or are None:

('HOME', '/root')
('LOGNAME', 'root')
('PATH', '/usr/bin:/bin')
('SHELL', '/bin/sh')
('PWD', '/root')
('LC_CTYPE', 'C.UTF-8')

Could you take a look?

@tomkralidis
Copy link
Collaborator Author

tomkralidis commented Jul 23, 2024

Thanks @nbuttdwd. The wis2-gdc environment is looking for various environment variables to be set (see https://github.com/wmo-im/wis2-gdc/blob/main/wis2-gdc-management/wis2_gdc/env.py#L61-L62) as part of the runtime.

Having said this, I pushed an update just now to this PR. Let me know if that helps. Thanks.

@nbuttdwd
Copy link

Hello Tom,
thanks - it worked now!

@tomkralidis tomkralidis merged commit e74278a into main Jul 24, 2024
2 checks passed
@tomkralidis tomkralidis deleted the issue-14 branch July 24, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wis2-gdc-archive.zip Cronjob didn't work
2 participants