Cannot update Bookstack #1623

Closed
opened 2026-02-05 01:27:02 +03:00 by OVERLORD · 6 comments
Owner

Originally created by @Emblaze3523 on GitHub (Apr 2, 2020).

Greeting.

This is the first time I am trying to update bookstack, and I keep getting an error that says it isn't able to connect to github because of a certificate failure.
I ran this command in my bookstack web directory as said on the "How to update" page:
git pull origin release && composer install --no-dev && php artisan migrate

You can see the error below:
Update failed (The "https://api.github.com/repos/symfony/console/zipball/e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed)

It then asks me if I want to try reinstalling the package instead. This ends up in the same since it can't connect probably to github.
I am hosting bookstack on a Ubuntu 18.04 VM.
And before asking, yes, the machine does have a working internet connection.

Originally created by @Emblaze3523 on GitHub (Apr 2, 2020). Greeting. This is the first time I am trying to update bookstack, and I keep getting an error that says it isn't able to connect to github because of a certificate failure. I ran this command in my bookstack web directory as said on the "How to update" page: `git pull origin release && composer install --no-dev && php artisan migrate` You can see the error below: `Update failed (The "https://api.github.com/repos/symfony/console/zipball/e9ee09d087e2c88eaf6e5fc0f5c574f64d100e4f" file could not be downloaded: SSL operation failed with code 1. OpenSSL Error messages: error:1416F086:SSL routines:tls_process_server_certificate:certificate verify failed Failed to enable crypto failed to open stream: operation failed)` It then asks me if I want to try reinstalling the package instead. This ends up in the same since it can't connect probably to github. I am hosting bookstack on a Ubuntu 18.04 VM. And before asking, yes, the machine does have a working internet connection.
Author
Owner

@ssddanbrown commented on GitHub (Apr 4, 2020):

Hi @7uppi,

  • Is the rest of the machine up to date? (Up-to-date apt packages?)
  • Do you have any anti-virus installed at all?
  • If you attempt again now do you get the exact same error?
@ssddanbrown commented on GitHub (Apr 4, 2020): Hi @7uppi, - Is the rest of the machine up to date? (Up-to-date apt packages?) - Do you have any anti-virus installed at all? - If you attempt again now do you get the exact same error?
Author
Owner

@Emblaze3523 commented on GitHub (Apr 6, 2020):

Hi @ssddanbrown

* Is the rest of the machine up to date? (Up-to-date apt packages?)

Yes it is. I also restarted the machine before trying to update bookstack just to be sure that every service was probably restarted after upgrading.

* Do you have any anti-virus installed at all?

No antivirus on the machine.

* If you attempt again now do you get the exact same error?

Yup.

I did find this on github, and tried to do what he said worked for him. That also worked for me, so I guess something was wrong with the certificate store on the machine.
However, I now have another problem.
When composer is done installing what is needed and php artisan begins, I get this:
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

In Application.php line 679:

Class 'Barryvdh\Debugbar\ServiceProvider' not found

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

What causes this? Is it because I have fucked permissions somewhere?
I got some permission errors to begin with, where it said what it didn't have permission to (vendor and logs), and gave it permission.
Thanks

@Emblaze3523 commented on GitHub (Apr 6, 2020): Hi @ssddanbrown > * Is the rest of the machine up to date? (Up-to-date apt packages?) Yes it is. I also restarted the machine before trying to update bookstack just to be sure that every service was probably restarted after upgrading. > > * Do you have any anti-virus installed at all? No antivirus on the machine. > > * If you attempt again now do you get the exact same error? Yup. I did find [this](https://github.com/composer/composer/issues/6870#issuecomment-462102219) on github, and tried to do what he said worked for him. That also worked for me, so I guess something was wrong with the certificate store on the machine. However, I now have another problem. When composer is done installing what is needed and php artisan begins, I get this: `> Illuminate\Foundation\ComposerScripts::postAutoloadDump` `> @php artisan package:discover --ansi` `In Application.php line 679:` ` Class 'Barryvdh\Debugbar\ServiceProvider' not found` `Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1` What causes this? Is it because I have fucked permissions somewhere? I got some permission errors to begin with, where it said what it didn't have permission to (vendor and logs), and gave it permission. Thanks
Author
Owner

@ssddanbrown commented on GitHub (Apr 6, 2020):

Looks like some dev packages got cached at some point. You could try running just composer install (Without the --no-dev part) and see if that gets you further.

@ssddanbrown commented on GitHub (Apr 6, 2020): Looks like some dev packages got cached at some point. You could try running just `composer install` (Without the `--no-dev` part) and see if that gets you further.
Author
Owner

@Emblaze3523 commented on GitHub (Apr 6, 2020):

It got me a little further. I did however just try to close port 80/443 traffic and give the webserver full access to every directory in /var/www/bookstack (my bookstack installation). That worked like a charm, and now it is updated.
That does bring me to my next question. How should permissions be on the individual files and folders? I mean, the bookstack docs says the webserver should only serve the public folder. Does that mean I can just remove access from other directories?

@Emblaze3523 commented on GitHub (Apr 6, 2020): It got me a little further. I did however just try to close port 80/443 traffic and give the webserver full access to every directory in /var/www/bookstack (my bookstack installation). That worked like a charm, and now it is updated. That does bring me to my next question. How should permissions be on the individual files and folders? I mean, the bookstack docs says the webserver should only serve the public folder. Does that mean I can just remove access from other directories?
Author
Owner

@codemicro commented on GitHub (Apr 6, 2020):

How should permissions be on the individual files and folders?

Everything in the /var/www/bookstack directory should be owned by the www-data user. You can set this for all files and directories in /var/www/bookstack with this command: sudo chown -R www-data:www-data /var/www/bookstack. It recursively sets the owner of everything to www-data, allowing the webserver to read and write to everything there. It's needed for things like writing logs and saving images.

the bookstack docs says the webserver should only serve the public folder. Does that mean I can just remove access from other directories?

The directory that your webserver serves should be /var/www/bookstack/public. If you're using Apache, you'd set that as something like:

Alias "/bookstack" "/var/www/bookstack/public"
<Directory /var/www/bookstack/public/>
    Options FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

This way, people on the internet can only access the items in bookstack/public but files there can still reference other files in the bookstack directory.

@codemicro commented on GitHub (Apr 6, 2020): > How should permissions be on the individual files and folders? Everything in the `/var/www/bookstack` directory should be owned by the `www-data` user. You can set this for all files and directories in `/var/www/bookstack` with this command: `sudo chown -R www-data:www-data /var/www/bookstack`. It recursively sets the owner of everything to `www-data`, allowing the webserver to read and write to everything there. It's needed for things like writing logs and saving images. > the bookstack docs says the webserver should only serve the public folder. Does that mean I can just remove access from other directories? The directory that your webserver serves should be `/var/www/bookstack/public`. If you're using Apache, you'd set that as something like: ``` Alias "/bookstack" "/var/www/bookstack/public" <Directory /var/www/bookstack/public/> Options FollowSymLinks AllowOverride All Require all granted </Directory> ``` This way, people on the internet can only access the items in `bookstack/public` but files there can still reference other files in the `bookstack` directory.
Author
Owner

@Emblaze3523 commented on GitHub (Apr 6, 2020):

@codemicro @ssddanbrown
That was all. Thank you very much!

@Emblaze3523 commented on GitHub (Apr 6, 2020): @codemicro @ssddanbrown That was all. Thank you very much!
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1623