unyt-org / uix

The UIX Framework
https://uix.unyt.org
MIT License
54 stars 3 forks source link

Catch error when trying to delete non-existing deno.lock file #143

Open benStre opened 3 months ago

benStre commented 3 months ago

Currently, the deno process crashes when trying to delete a non-existing deno.lock file (during UIX updates)

benStre commented 2 months ago

@asbng Do you know where exactly this happens / how it can reproduced? When removing the deno.lock file during updates, it is already checked beforehand if the file exists (https://github.com/unyt-org/uix/blob/46743bec51cc2a6b8cf70296d408ba2be2733c10/auto-update.ts#L29

asbng commented 2 months ago

Unfortunately, I don't have a stack trace for this. Let's close this issue until we can reproduce it.

asbng commented 2 months ago

Just got it again:

NotFound: No such file or directory (os error 2): remove '/home/user/uix-project/deno.lock'
    at async Object.remove (ext:deno_fs/30_fs.js:259:3)
    at async updateCache (https://cdn.unyt.org/uix/auto-update.ts:30:3)
benStre commented 2 months ago

This is really weird - we are definitely checking beforehand if the file exists with denoLock.fs_exists. Either this check does not work correctly, which should definitely not be the case, or the file is already deleted before Deno.remove is finished. I changed the async Deno.remove call to Deno.removeSync for the next release, hoping that this has an effect somehow, I don't know what else we could change.