mirror of
https://github.com/BookStackApp/BookStack.git
synced 2026-02-13 03:13:58 +03:00
SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'name'; check that column/key exists (SQL: alter table roles drop name)
#2155
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @csjjpm on GitHub (Mar 14, 2021).
When I do 'php artisan migrate' I get this error
Migrating: 2020_08_04_111754_drop_joint_permissions_id
Migrated: 2020_08_04_111754_drop_joint_permissions_id (1.59 seconds)
Migrating: 2020_08_04_131052_remove_role_name_field
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'name'; check that column/key exists (SQL: alter table
rolesdropname)at /usr/local/www/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
@csjjpm commented on GitHub (Mar 16, 2021):
If I create a blank database and import my SQL backup I get this error on the webpage.
'
UnexpectedValueException
The stream or file "/usr/local/www/BookStack/storage/logs/laravel.log" could not be opened in append mode: failed to open stream: Permission denied
'
If I try the migrate command I get this error:
'
Migrating: 2020_08_04_111754_drop_joint_permissions_id
Migrated: 2020_08_04_111754_drop_joint_permissions_id (2.14 seconds)
Migrating: 2020_08_04_131052_remove_role_name_field
Illuminate\Database\QueryException : SQLSTATE[42000]: Syntax error or access violation: 1091 Can't DROP 'name'; check that column/key exists (SQL: alter table
rolesdropname)at /usr/local/www/BookStack/vendor/laravel/framework/src/Illuminate/Database/Connection.php:669
665| // If an exception occurs when attempting to run a query, we'll format the error
666| // message to include the bindings with SQL, which will make this exception a
667| // lot more helpful to the developer instead of just the database's errors.
668| catch (Exception $e) {
@ssddanbrown commented on GitHub (Mar 17, 2021):
Hi @csjjpm,
This would indicate the webserver user does not have permission to write to the logs file when an error has occured. You'll need to review permissions set on the
storage/,bootstap/cacheandpublic/uploadsfolders.This would occur if you the migrations table has become out of sync with the database schema. Have you previously made manual edits to the database to get around previous errors? Or made edits to the
migrationstable at all?@csjjpm commented on GitHub (Mar 18, 2021):
Hi,
I gave my www user full write access to those folders as per instructions.
I have not touched the database schema, I have made no manual changes.
Thanks
Paul
@csjjpm commented on GitHub (Mar 18, 2021):
Hi,
although the folders had rwx the log file didn't. I have fixed that so the laravel.log error doesn't exist. Now I have this error after logging in.
@ssddanbrown commented on GitHub (Jul 26, 2022):
Since the last comment on this issue is relatively old I'm going to close this. If the issue remains and is something you still require to be fixed please open a new issue, referencing this one.