Update the upgrade docs to include dotenv changes #1826

Closed
opened 2026-02-05 02:00:23 +03:00 by OVERLORD · 3 comments
Owner

Originally created by @n0nag0n on GitHub (Aug 13, 2020).

Describe the bug
Just upgraded our wiki from an older version (possibly from Jan-Feb this year). In my .env file, I had a DB_PASSWORD value that had a @ and # character in it. After performing the upgrade my user suddenly didn't have privileges to the db (and the migration wouldn't work either)

Steps To Reproduce
Create a user/pass for MySQL and include the @ and/or # characters in it. I suspect it's probably #.
Try to migrate, or load the site. It'll fail with perms issues.

Expected behavior
Shouldn't blow up :)

Your Configuration (please complete the following information):

  • Exact BookStack Version (Found in settings): 0.29.3
  • PHP Version: 7.2
  • Hosting Method (Nginx/Apache/Docker): nginx

Additional context
I've already fixed this. I simply changed the password to something without those characters. I imagine that if I had put quotes around the password for DB_PASSWORD it would have fixed it as well now that I think about it.

Originally created by @n0nag0n on GitHub (Aug 13, 2020). **Describe the bug** Just upgraded our wiki from an older version (possibly from Jan-Feb this year). In my `.env` file, I had a `DB_PASSWORD` value that had a `@` and `#` character in it. After performing the upgrade my user suddenly didn't have privileges to the db (and the migration wouldn't work either) **Steps To Reproduce** Create a user/pass for MySQL and include the `@` and/or `#` characters in it. I suspect it's probably `#`. Try to migrate, or load the site. It'll fail with perms issues. **Expected behavior** Shouldn't blow up :) **Your Configuration (please complete the following information):** - Exact BookStack Version (Found in settings): 0.29.3 - PHP Version: 7.2 - Hosting Method (Nginx/Apache/Docker): nginx **Additional context** I've already fixed this. I simply changed the password to something without those characters. I imagine that if I had put quotes around the password for `DB_PASSWORD` it would have fixed it as well now that I think about it.
OVERLORD added the 📖 Docs Update label 2026-02-05 02:00:23 +03:00
Author
Owner

@ryanc-me commented on GitHub (Aug 15, 2020):

See #27850 on Laravel - it looks like strings need to be SETTING="quoted#" if they have hashtags in them.

Perhaps the Bookstack docs should be updated with a reference to this?

@ryanc-me commented on GitHub (Aug 15, 2020): See [#27850](https://github.com/laravel/framework/issues/27850) on Laravel - it looks like strings need to be `SETTING="quoted#"` if they have hashtags in them. Perhaps the Bookstack docs should be updated with a reference to this?
Author
Owner

@alexmannuk commented on GitHub (Aug 24, 2020):

This is default behaviour from the php dotenv library which was updated in between Laravel versions 5.7 and 5.8 where # is treated as a comment unless quoted. This should definitely be in the doc, will aim to make a PR for the doc later

@alexmannuk commented on GitHub (Aug 24, 2020): This is default behaviour from the php dotenv library which was updated in between Laravel versions 5.7 and 5.8 where # is treated as a comment unless quoted. This should definitely be in the doc, will aim to make a PR for the doc later
Author
Owner

@ssddanbrown commented on GitHub (Dec 17, 2020):

Thanks for raising and reporting @n0nag0n; And thanks for supporting @ryanc-me and @alexmannuk.

In September I updated the default .env.example file to include a note about this case: 00308ad4ab/.env.example (L6-L7)

Really, I should have included this in the v0.28 update notes but it got missed. Missed the boat on that one by this point. Since I added the note to the .env for future users I'll close this off.

@ssddanbrown commented on GitHub (Dec 17, 2020): Thanks for raising and reporting @n0nag0n; And thanks for supporting @ryanc-me and @alexmannuk. In September I updated the default `.env.example` file to include a note about this case: https://github.com/BookStackApp/BookStack/blob/00308ad4ab9302293afd0a65f815feeaca06b626/.env.example#L6-L7 Really, I should have included this in the v0.28 update notes but it got missed. Missed the boat on that one by this point. Since I added the note to the `.env` for future users I'll close this off.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#1826