Int or str ? hours until trash permanently deleted

Hello,

I just wanted to know if that error is normal at launch ?

 [EXPORT_WORKER][2023-01-14 09:56:16] [2023-01-14 09:56:16,076: ERROR/ForkPoolWorker-1] Task baserow.core.trash.tasks.mark_old_trash_for_permanent_deletion[72e95c2d-6e83-4d2f-9fc6-c07db030aa42] raised unexpected: TypeError('unsupported type for timedelta hours component: str')  
 [EXPORT_WORKER][2023-01-14 09:56:16] Traceback (most recent call last):  
 [EXPORT_WORKER][2023-01-14 09:56:16]   File "/baserow/venv/lib/python3.9/site-packages/celery/app/trace.py", line 451, in trace_task  
 [EXPORT_WORKER][2023-01-14 09:56:16]     R = retval = fun(*args, **kwargs)  
 [EXPORT_WORKER][2023-01-14 09:56:16]   File "/baserow/venv/lib/python3.9/site-packages/celery/app/trace.py", line 734, in __protected_call__  
 [EXPORT_WORKER][2023-01-14 09:56:16]     return self.run(*args, **kwargs)  
 [EXPORT_WORKER][2023-01-14 09:56:16]   File "/baserow/backend/src/baserow/core/trash/tasks.py", line 15, in mark_old_trash_for_permanent_deletion  
 [EXPORT_WORKER][2023-01-14 09:56:16]     TrashHandler.mark_old_trash_for_permanent_deletion()  
 [EXPORT_WORKER][2023-01-14 09:56:16]   File "/baserow/backend/src/baserow/core/trash/handler.py", line 200, in mark_old_trash_for_permanent_deletion  
 [EXPORT_WORKER][2023-01-14 09:56:16]     cutoff = now - timezone.timedelta(hours=hours)  
 [EXPORT_WORKER][2023-01-14 09:56:16] TypeError: unsupported type for timedelta hours component: str  
 [EXPORT_WORKER][2023-01-14 09:56:16] [2023-01-14 09:56:16,097: INFO/ForkPoolWorker-1] Successfully deleted 0 trash entries and their associated trashed items. 

I used the below environment variable to run the docker

-e HOURS_UNTIL_TRASH_PERMANENTLY_DELETED=720

Thanks

That looks like your value is correct but from what I remember args are passed as strings so it sounds like there could be a missing conversion in the image to handle that.

1 Like

ok, so let’s see in the next release

Will need to get @nigel, @bram or another member of the Baserow team to confirm first :smiley:

Thanks for looking into this @joffcom, It indeed seems like the HOURS_UNTIL_TRASH_PERMANENTLY_DELETED environment variable is not converted to an int and that’s causing the problem. I’ve created an issue for it here: HOURS_UNTIL_TRASH_PERMANENTLY_DELETED environment variable is not converted to int (#1499) · Issues · Bram Wiepjes / baserow · GitLab and we’ll try to fix it before the release of 1.14.

1 Like