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

"Failed to lock the file" error after installing Shaarli #1650

Closed
uraza opened this issue Nov 23, 2020 · 5 comments · Fixed by #1652
Closed

"Failed to lock the file" error after installing Shaarli #1650

uraza opened this issue Nov 23, 2020 · 5 comments · Fixed by #1652
Labels
bug it's broken! support installation and configuration issues
Milestone

Comments

@uraza
Copy link

uraza commented Nov 23, 2020

Hi.

I am new to Shaarli and I just set it up on a shared hosting.

After copying the files on my server, I was able to access it and all requirements seemed to be fulfilled:

image

However, after clicking the "Install" button, I ended up with a bunch of errors like this:

An unexpected error happened, and the error template could not be displayed.

Failed to lock the file.
/srv/data/web/vhosts/<my_domain>/htdocs/vendor/malkusch/lock/classes/mutex/FlockMutex.php141
#0 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/malkusch/lock/classes/mutex/FlockMutex.php(122): malkusch\lock\mutex\FlockMutex->acquireNonBlockingLock()
#1 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/malkusch/lock/classes/util/Loop.php(90): malkusch\lock\mutex\FlockMutex->malkusch\lock\mutex{closure}()
#2 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/malkusch/lock/classes/mutex/FlockMutex.php(125): malkusch\lock\util\Loop->execute()
#3 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/malkusch/lock/classes/mutex/FlockMutex.php(160): malkusch\lock\mutex\FlockMutex->lockBusy()
#4 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/malkusch/lock/classes/mutex/LockMutex.php(37): malkusch\lock\mutex\FlockMutex->lock()
#5 /srv/data/web/vhosts/<my_domain>/htdocs/application/bookmark/BookmarkIO.php(127): malkusch\lock\mutex\LockMutex->synchronized()
#6 /srv/data/web/vhosts/<my_domain>/htdocs/application/bookmark/BookmarkFileService.php(299): Shaarli\Bookmark\BookmarkIO->write()
#7 /srv/data/web/vhosts/<my_domain>/htdocs/application/bookmark/BookmarkFileService.php(397): Shaarli\Bookmark\BookmarkFileService->save()
#8 /srv/data/web/vhosts/<my_domain>/htdocs/application/bookmark/BookmarkFileService.php(78): Shaarli\Bookmark\BookmarkFileService->initialize()
#9 /srv/data/web/vhosts/<my_domain>/htdocs/application/container/ContainerBuilder.php(97): Shaarli\Bookmark\BookmarkFileService->__construct()
#10 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/pimple/pimple/src/Pimple/Container.php(118): Shaarli\Container\ContainerBuilder->Shaarli\Container{closure}()
#11 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/Container.php(109): Pimple\Container->offsetGet()
#12 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/Container.php(164): Slim\Container->get()
#13 /srv/data/web/vhosts/<my_domain>/htdocs/application/container/ContainerBuilder.php(110): Slim\Container->__get()
#14 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/pimple/pimple/src/Pimple/Container.php(118): Shaarli\Container\ContainerBuilder->Shaarli\Container{closure}()
#15 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/Container.php(109): Pimple\Container->offsetGet()
#16 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/Container.php(164): Slim\Container->get()
#17 /srv/data/web/vhosts/<my_domain>/htdocs/application/front/controller/visitor/ErrorController.php(20): Slim\Container->__get()
#18 [internal function]: Shaarli\Front\Controller\Visitor\ErrorController->__invoke()
#19 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/App.php(701): call_user_func_array()
#20 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/App.php(394): Slim\App->handleException()
#21 /srv/data/web/vhosts/<my_domain>/htdocs/vendor/slim/slim/Slim/App.php(297): Slim\App->process()
#22 /srv/data/web/vhosts/<my_domain>/htdocs/index.php(176): Slim\App->run()
#23 {main}

It only fails if I am logged in.
Removing the cookies and accessing the page is fine, until I try to log in again.

Any idea what could be wrong?

Thanks.

Jérémy

@ArthurHoaro
Copy link
Member

Hi, does data/datastore.php exists? Otherwise can you try to create it manually, and make sure it's writable.

@ArthurHoaro ArthurHoaro added bug it's broken! support installation and configuration issues unconfirmed labels Nov 23, 2020
@ArthurHoaro ArthurHoaro added this to the 0.12.2 milestone Nov 23, 2020
@uraza
Copy link
Author

uraza commented Nov 23, 2020

Hi @ArthurHoaro

The data/datastore.php file was missing so I created it (as empty) and made it writable.

Here is the content of my data folder now:

image

The same error happens when accessing Shaarli though.
The log.txt file shows my successful logins to Shaarli but no other information.

Jérémy

@ArthurHoaro
Copy link
Member

I looked more precisely at your exception and it looks like flock function is not working, probably due to the setup of your shared hosting.

I will provide a PR to make this error non-blocking.

In the meantime you can either rollback to v0.12.0 or manually put following line outside of this if in the code:

$mutex = new NoMutex();

@uraza
Copy link
Author

uraza commented Nov 24, 2020

It works with that change (I also had to remove the empty data/datastore.php created yesterday).
I will let you know if I find anything else, shared hostings can have weird setups from time to time.
Thanks for the help!

ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Nov 24, 2020
And display the error in server admin page

Fixes shaarli#1650
ArthurHoaro added a commit to ArthurHoaro/Shaarli that referenced this issue Nov 24, 2020
And display the error in server admin page

Fixes shaarli#1650
@RolandTi
Copy link

RolandTi commented Dec 2, 2020

Same thing happens at gandi.net
thanks for the fix :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug it's broken! support installation and configuration issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants