GEUS-Glaciology-and-Climate / pypromice

Process AWS data from L0 (raw logger) through Lx (end user)
https://pypromice.readthedocs.io
GNU General Public License v2.0
14 stars 4 forks source link

no uid for latest email #76

Closed patrickjwright closed 1 year ago

patrickjwright commented 1 year ago

Occasionally, if I re-run the processing script to test (between cron runs), and I don't touch the last_aws_uid.ini, after looking for new emails we get:

Traceback (most recent call last):
  File "/home/aws/miniconda3/envs/py38/bin/getL0tx", line 168, in <module>
    last_uid_f.write(str(uid))
NameError: name 'uid' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/aws/miniconda3/envs/py38/bin/getL0tx", line 170, in <module>
    print(f'Could not write last uid {uid} to {uid_file}')
NameError: name 'uid' is not defined

And then last_aws_uid.ini is empty.

PennyHow commented 1 year ago

Yes, I get this too. This occurs in the L0 tx fetching. If a run fetches no new messages then last_aws_uid.ini is overwritten with None as the uid variable used for looping through the messages is also None. I think this should be something quite easy to fix.

patrickjwright commented 1 year ago

Specifically, the traceback is:

Traceback (most recent call last):
  File "/home/pwright/miniconda3/envs/py38/bin/getL0tx", line 168, in <module>
    last_uid_f.write(str(uid))
NameError: name 'uid' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pwright/miniconda3/envs/py38/bin/getL0tx", line 170, in <module>
    print(f'Could not write last uid {uid} to {uid_file}')
NameError: name 'uid' is not defined