screenshotbot / screenshotbot-oss

A Screenshot Testing service to tie with your existing Android, iOS and Web screenshot tests
https://screenshotbot.io
Mozilla Public License 2.0
238 stars 13 forks source link

Failed to create lock: No such file or directory #8

Closed liweijian closed 3 years ago

liweijian commented 3 years ago

I tried to run it in a not-clean-centos system, and got errors:

; Loading "screenshotbot"
...
 <INFO> [14:00:36] screenshotbot/config config.lisp (load-config) - Loading config at config.lisp
 <INFO> [14:00:36] server setup.lisp (main) - args is: ("<arg0>")
 <INFO> [14:00:36] server setup.lisp (main) - The port is now 4091
Failed to create lock: No such file or directory
Failed to create lock: No such file or directory
Failed to create lock: No such file or directory
Failed to create lock: No such file or directory
Failed to create lock: No such file or directory
Failed to create lock: No such file or directory

It sounds a lot like from : https://github.com/screenshotbot/screenshotbot-oss/blob/2372e102c5ef391ed63aa096f678e2ad1df36afe/src/util/store-native.c#L15

Just wondering how do we know what's the specific file/folder that needs to change chmod 777 ?

tdrhq commented 3 years ago

Hmm, that's certainly a bug. This is the directory it's trying to create the lock in: https://github.com/screenshotbot/screenshotbot-oss/blob/main/src/server/setup.lisp#L54, which can be configured with --object-store. It should've created the directory if it didn't already exist. On docker, it uses /data/ which is already created by the volume mount which is probably why this error doesn't show up with docker.

tdrhq commented 3 years ago

Fixed in https://github.com/screenshotbot/screenshotbot-oss/commit/4aaba6f6a20d075d37bb6ea47a8a7252c3c0ef6d

But let me also improve the error message

tdrhq commented 3 years ago

There was actually a more descriptive error logged that would've told you which lock file we were looking for, but that logging went into log/logs file. I've improved the startup logging setup to log to console. (Towards the end we'll switch logs to log/logs, but before we do that we'll remind you on the console). This fix is in: https://github.com/screenshotbot/screenshotbot-oss/commit/b1290e4e2ede256d0d7c28a644fb05f92448856a