Can't seem to enable attachments #360

Closed
opened 2026-02-04 18:59:57 +03:00 by OVERLORD · 12 comments
Owner

Originally created by @mzw123 on GitHub (Jun 21, 2017).

For Bug Reports

attachment upload limit set to 10M in php.conf:
post_max_size = 10M
upload_max_filesize = 10M

attachment upload limit set to 10M in nginx.conf:

http {
    client_max_body_size 10m;
    client_body_timeout 120s;
...

/var/www/BookStack/public
drwxrwxrwx. 7 nginx nginx 4096 Jun 15 14:35 public
/var/www/BookStack/storage/uploads
drwxrwxrwx. 3 nginx nginx 4096 Apr 18 14:11 uploads

Expected Behavior

I would be able to set attachment permissions and upload attachments.

Actual Behavior

I do not see the paperclip icon when editing pages so there is no way to open the attachment interface.
When I try to set the attachment permissions in settings/roles the changes are not saved. i.e. I check all the boxes, save the role and they are unchecked when I open the role again.

I'm not sure what I am missing in order to enable attachments. Any help would be appreciated.
Thanks

Originally created by @mzw123 on GitHub (Jun 21, 2017). ### For Bug Reports * BookStack Version: BookStack v0.16.3 * PHP Version: PHP 5.6.30 * MySQL Version: mysql Ver 15.1 Distrib 5.5.52-MariaDB Installed on RHEL7 as per [CentOS 7 Install by Deviant Engineer](https://deviantengineer.com/2017/02/bookstack-centos7/) attachment upload limit set to 10M in php.conf: `post_max_size = 10M` `upload_max_filesize = 10M` attachment upload limit set to 10M in nginx.conf: ``` http { client_max_body_size 10m; client_body_timeout 120s; ... ``` /var/www/BookStack/public `drwxrwxrwx. 7 nginx nginx 4096 Jun 15 14:35 public` /var/www/BookStack/storage/uploads `drwxrwxrwx. 3 nginx nginx 4096 Apr 18 14:11 uploads` ##### Expected Behavior I would be able to set attachment permissions and upload attachments. ##### Actual Behavior I do not see the paperclip icon when editing pages so there is no way to open the attachment interface. When I try to set the attachment permissions in settings/roles the changes are not saved. i.e. I check all the boxes, save the role and they are unchecked when I open the role again. I'm not sure what I am missing in order to enable attachments. Any help would be appreciated. Thanks
OVERLORD added the 🐕 Support label 2026-02-04 18:59:57 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Jul 1, 2017):

Hi @mzw123, I'm assuming your account is an admin account in BookStack? Would you be able to post a screenshot of what the admin role permissions look like?

@ssddanbrown commented on GitHub (Jul 1, 2017): Hi @mzw123, I'm assuming your account is an admin account in BookStack? Would you be able to post a screenshot of what the admin role permissions look like?
Author
Owner

@mzw123 commented on GitHub (Jul 3, 2017):

I have tried checking all the Attachments boxes but the changes are not saved.
Current Admin settings:
[cid:image002.jpg@01D2F3DC.D991C750]

From: Dan Brown [mailto:notifications@github.com]
Sent: Saturday, July 01, 2017 3:09 AM
To: BookStackApp/BookStack BookStack@noreply.github.com
Cc: Warren, Michael Z mwarren@lanl.gov; Mention mention@noreply.github.com
Subject: Re: [BookStackApp/BookStack] Can't seem to enable attachments (#418)

Hi @mzw123https://github.com/mzw123, I'm assuming your account is an admin account in BookStack? Would you be able to post a screenshot of what the admin role permissions look like?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/BookStackApp/BookStack/issues/418#issuecomment-312420785, or mute the threadhttps://github.com/notifications/unsubscribe-auth/Aa9uz-fKp5QjmO4yu7kYlt6Tb7a8Aacrks5sJgyegaJpZM4OBFxF.

@mzw123 commented on GitHub (Jul 3, 2017): I have tried checking all the Attachments boxes but the changes are not saved. Current Admin settings: [cid:image002.jpg@01D2F3DC.D991C750] From: Dan Brown [mailto:notifications@github.com] Sent: Saturday, July 01, 2017 3:09 AM To: BookStackApp/BookStack <BookStack@noreply.github.com> Cc: Warren, Michael Z <mwarren@lanl.gov>; Mention <mention@noreply.github.com> Subject: Re: [BookStackApp/BookStack] Can't seem to enable attachments (#418) Hi @mzw123<https://github.com/mzw123>, I'm assuming your account is an admin account in BookStack? Would you be able to post a screenshot of what the admin role permissions look like? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub<https://github.com/BookStackApp/BookStack/issues/418#issuecomment-312420785>, or mute the thread<https://github.com/notifications/unsubscribe-auth/Aa9uz-fKp5QjmO4yu7kYlt6Tb7a8Aacrks5sJgyegaJpZM4OBFxF>.
Author
Owner

@mzw123 commented on GitHub (Aug 25, 2017):

Hi @ssddanbrown, Do you have any thoughts on what I could investigate to enable attachments?

@mzw123 commented on GitHub (Aug 25, 2017): Hi @ssddanbrown, Do you have any thoughts on what I could investigate to enable attachments?
Author
Owner

@ssddanbrown commented on GitHub (Aug 26, 2017):

@mzw123 Please try updating to the latest BookStack version. Also, If possible, Please could you post a screenshot of the role configuration for admin users?

@ssddanbrown commented on GitHub (Aug 26, 2017): @mzw123 Please try updating to the latest BookStack version. Also, If possible, Please could you post a screenshot of the role configuration for admin users?
Author
Owner

@mzw123 commented on GitHub (Aug 28, 2017):

As you can see the attachments aren't enabled. When I select the attachment checkboxes they do not save.

image

@mzw123 commented on GitHub (Aug 28, 2017): As you can see the attachments aren't enabled. When I select the attachment checkboxes they do not save. ![image](https://user-images.githubusercontent.com/28274383/29776482-f4b44978-8bc5-11e7-85a4-da3e3a533c14.png)
Author
Owner

@ssddanbrown commented on GitHub (Aug 28, 2017):

@mzw123 Could you try enabling attachments on another role? The admin account is handled a little differently so just want to see if things act differently for a non-admin role.

I'm suspecting an upgrade may have gone wrong at some point and you don't have the latest correct role permissions in your database. Definitely all up-to-date when running php artisan migrate. Ever seen errors when running that upon updating?

@ssddanbrown commented on GitHub (Aug 28, 2017): @mzw123 Could you try enabling attachments on another role? The admin account is handled a little differently so just want to see if things act differently for a non-admin role. I'm suspecting an upgrade may have gone wrong at some point and you don't have the latest correct role permissions in your database. Definitely all up-to-date when running `php artisan migrate`. Ever seen errors when running that upon updating?
Author
Owner

@mzw123 commented on GitHub (Aug 29, 2017):

I tried updating and did get an error regarding the attachments table:

[Illuminate\Database\QueryException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachments
' already exists (SQL: create table attachments (id int unsigned not nu
ll auto_increment primary key, name varchar(191) not null, path varchar
(191) not null, extension varchar(20) not null, uploaded_to int not nul
l, external tinyint(1) not null, order int not null, created_by int n
ot null, updated_by int not null, created_at timestamp null, updated_a t timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci
)

[PDOException]
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachments
' already exists

@mzw123 commented on GitHub (Aug 29, 2017): I tried updating and did get an error regarding the attachments table: [Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachments ' already exists (SQL: create table `attachments` (`id` int unsigned not nu ll auto_increment primary key, `name` varchar(191) not null, `path` varchar (191) not null, `extension` varchar(20) not null, `uploaded_to` int not nul l, `external` tinyint(1) not null, `order` int not null, `created_by` int n ot null, `updated_by` int not null, `created_at` timestamp null, `updated_a t` timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci ) [PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'attachments ' already exists
Author
Owner

@ssddanbrown commented on GitHub (Aug 29, 2017):

@mzw123 Okay, That indicates that something wrong has occurred on a previous update and, as per my previous comment, You don't have the latest permission options in your system.

Sorting this out might be tricky as it's hard to know what the original issue is. In your database, You can try manually dropping the attachments table and then re-running the migrate. Please backup first and note any errors.

@ssddanbrown commented on GitHub (Aug 29, 2017): @mzw123 Okay, That indicates that something wrong has occurred on a previous update and, as per my previous comment, You don't have the latest permission options in your system. Sorting this out might be tricky as it's hard to know what the original issue is. In your database, You can try manually dropping the `attachments` table and then re-running the migrate. Please backup first and note any errors.
Author
Owner

@mzw123 commented on GitHub (Aug 29, 2017):

This may stem from the fact that I originally started with a docker install that broke when I patched the server it was on. I rebuilt the app outside of docker and added back the db and files from the docker installation.

I dropped the attachments table and re-ran the update. I got the following error:

[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) (SQL: select * from
information_schema.tables where table_schema = forge and table_name = migrations)

[PDOException]
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)

@mzw123 commented on GitHub (Aug 29, 2017): This may stem from the fact that I originally started with a docker install that broke when I patched the server it was on. I rebuilt the app outside of docker and added back the db and files from the docker installation. I dropped the attachments table and re-ran the update. I got the following error: [Illuminate\Database\QueryException] SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) (SQL: select * from information_schema.tables where table_schema = forge and table_name = migrations) [PDOException] SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)
Author
Owner

@Abijeet commented on GitHub (Aug 30, 2017):

Under the instructions section on the page here - https://www.bookstackapp.com/docs/admin/installation/

Did you follow step 3 ?

Copy the .env.example file to .env and fill with your own database and mail details.

You need to use your database credentials to connect to the database.

@Abijeet commented on GitHub (Aug 30, 2017): Under the instructions section on the page here - https://www.bookstackapp.com/docs/admin/installation/ Did you follow step 3 ? ``` Copy the .env.example file to .env and fill with your own database and mail details. ``` You need to use your database credentials to connect to the database.
Author
Owner

@ssddanbrown commented on GitHub (Feb 17, 2018):

Closing due to time since last response. If this remains to be an issue feel free to comment and this can be re-opened.

@ssddanbrown commented on GitHub (Feb 17, 2018): Closing due to time since last response. If this remains to be an issue feel free to comment and this can be re-opened.
Author
Owner

@spike3579 commented on GitHub (Feb 20, 2018):

I was not able to fix the DB so I started over from scratch and everything worked as expected.

@spike3579 commented on GitHub (Feb 20, 2018): I was not able to fix the DB so I started over from scratch and everything worked as expected.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#360