<p>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'.</p>

<p>After getting this error the page cannot be accessed at all.</p>

<p>I'm using SuperTable, too.</p>

<p>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.</p>

CC BY-SA 4.0
2018-10-13T22:10:06.683Z
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
CC BY-SA 4.0
2018-10-15T13:49:54.620Z
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
CC BY-SA 4.0
2018-10-15T18:12:15.357Z
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
CC BY-SA 4.0
2018-10-15T19:50:05.570Z
Agree with stepbyweb, thank you for the solution Andrew. I was also able to resolve the issue by dropping in MariaDB
TheCodeNomad
CC BY-SA 4.0
2018-10-15T22:13:36.603Z
Both MySQL and MariaDB are fully supported by Craft; this issue is something I'd probably get in touch with the folks at P&T about: support@craftcms.com -- it nothing else other than to make sure they are aware of it (and they may have another workaround as well). I personally prefer MariaDB, but either it or MySQL are both equally good choices for Craft CMS (as is Postgres).
andrew.welch
CC BY-SA 4.0
2018-10-15T23:05:36.357Z
Is there a chance that either of you changed something in `app.php` or such to change the default behavior? Craft normally uses file-base locks for these things... I'm puzzled as to how this could be ending up in your db?
andrew.welch
CC BY-SA 4.0
2018-10-15T23:07:58.373Z
@TheCodeNomad If there's any chance you could share the full stack trace leading up to that error, that'd be helpful in debugging, too.
Brad Bell
CC BY-SA 4.0
2018-10-16T16:19:55.870Z
@andrew.welch I did add the mutex component to my app.php in order to resolve a previous issue
TheCodeNomad
CC BY-SA 4.0
2018-10-16T16:27:34.043Z
Brad, I updated my question with an image of the stack trace
TheCodeNomad
CC BY-SA 4.0
2018-10-16T20:48:36.160Z
Thanks, @TheCodeNomad - this shouldn't be an issue going forward with https://github.com/craftcms/cms/commit/dd21625170255df8338385449f2bb4620b5fc56e
Brad Bell
CC BY-SA 4.0
2018-10-13T20:48:26.897Z
2018-10-13T20:48:26.897Z
stepbyweb
<p>When creating a new field, I received a Database Exception error - </p>

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

<p>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.</p>

<p>Installed Plugins</p>

<ul>
<li>SEOmatic</li>
<li>Element API</li>
<li>SuperTable</li>
</ul>

<p>Any assistance would be greatly appreciated</p>

<p><a href="https://i.sstatic.net/CRLZh.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/CRLZh.png" alt="Error Screenshot"></a></p>

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

<p><a href="https://i.sstatic.net/BWUVU.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/BWUVU.png" alt="Content Behavior Not Found"></a></p>

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

<p><a href="https://i.sstatic.net/Ktowh.jpg" rel="nofollow noreferrer">https://i.sstatic.net/Ktowh.jpg</a></p>

<craft3><mysql>
Incorrect user-level lock name - Local Vagrant Environment - Craft 3
# Incorrect user-level lock name - Local Vagrant Environment - Craft 3

(Asked by: username_0 on 2018-10-12)

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](https://i.sstatic.net/CRLZh.png)](https://i.sstatic.net/CRLZh.png)

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

[![Content Behavior Not Found](https://i.sstatic.net/BWUVU.png)](https://i.sstatic.net/BWUVU.png)

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

<https://i.sstatic.net/Ktowh.jpg>

**Tags:** craft3, mysql

---

## 1 answers

### Answer by username_1 on 2018-10-13. Score: 1 | Accepted answer

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.

> **Comments:**
> **username_2**: 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`  
> **username_0**: 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  
> **username_1**: 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. :)  
> **username_0**: Agree with stepbyweb, thank you for the solution Andrew. I was also able to resolve the issue by dropping in MariaDB  
> **username_2**: Both MySQL and MariaDB are fully supported by Craft; this issue is something I'd probably get in touch with the folks at P&T about: support@craftcms.com -- it nothing else other than to make sure they are aware of it (and they may have another workaround as well). I personally prefer MariaDB, but either it or MySQL are both equally good choices for Craft CMS (as is Postgres).  
> **username_2**: Is there a chance that either of you changed something in `app.php` or such to change the default behavior? Craft normally uses file-base locks for these things... I'm puzzled as to how this could be ending up in your db?  
> **username_3**: @TheCodeNomad If there's any chance you could share the full stack trace leading up to that error, that'd be helpful in debugging, too.  
> **username_0**: @andrew.welch I did add the mutex component to my app.php in order to resolve a previous issue  
> **username_0**: Brad, I updated my question with an image of the stack trace  
> **username_3**: Thanks, @TheCodeNomad - this shouldn't be an issue going forward with https://github.com/craftcms/cms/commit/dd21625170255df8338385449f2bb4620b5fc56e  

---

