1

When creating a new field, I received a Database Exception error -

SQLSTATE[42000]: Syntax error or access violation: 3057 Incorrect user-level lock name '/var/www/storage/runtime/compiled_classes/ElementQueryBehavior.php'.

Loading an older database backup did not resolve the error, and neither did checking out an older branch. I am unable to access the panel or the site itself.

Installed Plugins

  • SEOmatic
  • Element API
  • SuperTable

Any assistance would be greatly appreciated

Error Screenshot

Edit: After dropping/creating the database multiple times, I am now getting this error instead

Content Behavior Not Found

Edit 2: Here is a link to the full stack trace, which was posted to imgur due to the length

https://imgur.com/a/ADSvGCj

1

I just ran into the exact same error on my Vagrant/Homestead environment when creating a field just with the lock name '/home/vagrant/code/craft/storage/runtime/compiled_classes/ContentBehavior.php'.

After getting this error the page cannot be accessed at all.

I'm using SuperTable, too.

The error itself seems to come from MySQL 5.7 where there is a character limit for the user-level lock names of 64 characters. Here the GET_LOCK statement fails. I just don't know how to fix it right now.

| improve this answer | |
  • If you're using Homestead, just switch it to use MariaDB and away you go. You just change a line in the YAML and do homestead up --provision – andrew.welch Oct 13 '18 at 22:10
  • Is MariaDB the preferred option for Craft 3? If this is an avoidable error, I would prefer to just avoid it, but if using MySQL will continue to cause issues I would definitely want to look into MariaDB – TheCodeNomad Oct 15 '18 at 13:49
  • Thank you @andrew.welch Seems to work so far. I ran into problems with MySQL and Craft in different environments. Hope this has an end now. :) – stepbyweb Oct 15 '18 at 18:12
  • Agree with stepbyweb, thank you for the solution Andrew. I was also able to resolve the issue by dropping in MariaDB – TheCodeNomad Oct 15 '18 at 19:50
  • 2
    Thanks, @TheCodeNomad - this shouldn't be an issue going forward with github.com/craftcms/cms/commit/… – Brad Bell Oct 16 '18 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.