Issues with database backend if IPv6 address provided #3338

Closed
opened 2026-02-05 06:24:10 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @i-cannot-decide-on-a-username on GitHub (Nov 11, 2022).

Attempted Debugging

  • I have read the debugging page

Searched GitHub Issues

  • I have searched GitHub for the issue.

Describe the Scenario

When setting the "DB_HOST" database migration fails due to the IPv6 Address being interpreted incorrectly.

Ignore that mysql binaries are missing the important part is that the migrate commands does not work due to the IPv6 address being read as a IPV4 with the : as the divider.

Exact BookStack Version

v22.10

Log Content

root@b0e397e9c977:/app/www# export DB_HOST="XXXX:NNA:ZZZZ:::abc"
root@b0e397e9c977:/app/www# php artisan db
sh: exec: line 1: mysql: not found

Symfony\Component\Process\Exception\ProcessFailedException

The command "'mysql' '--host=XXXX' '--port=NN' '--user=' '--password=' '--default-character-set=utf8mb4' 'bookstack'" failed.

Exit Code: 127(Command not found)

Working directory: /app/www

Output:

Error Output:

at vendor/symfony/process/Process.php:272
268▕ */
269▕ public function mustRun(callable $callback = null, array $env = []): self
270▕ {
271▕ if (0 !== $this->run($callback, $env)) {
➜ 272▕ throw new ProcessFailedException($this);
273▕ }
274▕
275▕ return $this;
276▕ }

  +14 vendor frames 

15 artisan:37
Illuminate\Foundation\Console\Kernel::handle()

PHP Version

No response

Hosting Environment

Podman 3.0
Rockylinux 8.6
Linuxserverio container

Originally created by @i-cannot-decide-on-a-username on GitHub (Nov 11, 2022). ### Attempted Debugging - [X] I have read the debugging page ### Searched GitHub Issues - [X] I have searched GitHub for the issue. ### Describe the Scenario When setting the "DB_HOST" database migration fails due to the IPv6 Address being interpreted incorrectly. Ignore that mysql binaries are missing the important part is that the migrate commands does not work due to the IPv6 address being read as a IPV4 with the : as the divider. ### Exact BookStack Version v22.10 ### Log Content root@b0e397e9c977:/app/www# export DB_HOST="XXXX:NNA:ZZZZ:::abc" root@b0e397e9c977:/app/www# php artisan db sh: exec: line 1: mysql: not found Symfony\Component\Process\Exception\ProcessFailedException The command "'mysql' '--host=XXXX' '--port=NN' '--user=' '--password=' '--default-character-set=utf8mb4' 'bookstack'" failed. Exit Code: 127(Command not found) Working directory: /app/www Output: ================ Error Output: ================ at vendor/symfony/process/Process.php:272 268▕ */ 269▕ public function mustRun(callable $callback = null, array $env = []): self 270▕ { 271▕ if (0 !== $this->run($callback, $env)) { ➜ 272▕ throw new ProcessFailedException($this); 273▕ } 274▕ 275▕ return $this; 276▕ } +14 vendor frames 15 artisan:37 Illuminate\Foundation\Console\Kernel::handle() ### PHP Version _No response_ ### Hosting Environment Podman 3.0 Rockylinux 8.6 Linuxserverio container
OVERLORD added the 🐕 Support label 2026-02-05 06:24:10 +03:00
Author
Owner

@ssddanbrown commented on GitHub (Nov 11, 2022):

Hi @i-cannot-decide-on-a-username,
Yeah, I don't think our database host handling is IPv6 friendly right now, and never had this previously arise or be requested.

I have not tested this, but if really needed right now you might be able to use this unsupported/undocumented workaround via instead using:

DATABASE_URL="mysql://user:password@XXXX:NNA:ZZZZ:::abc"
@ssddanbrown commented on GitHub (Nov 11, 2022): Hi @i-cannot-decide-on-a-username, Yeah, I don't think our database host handling is IPv6 friendly right now, and never had this previously arise or be requested. I have not tested this, but if really needed right now you might be able to use this unsupported/undocumented workaround via instead using: ``` DATABASE_URL="mysql://user:password@XXXX:NNA:ZZZZ:::abc" ```
Author
Owner

@i-cannot-decide-on-a-username commented on GitHub (Nov 14, 2022):

Did try parts of that without the username and password. Our workaround became to use the IPv4 addressing instead. So I am closing this and will after-the-fact inform when we test the workaround.

@i-cannot-decide-on-a-username commented on GitHub (Nov 14, 2022): Did try parts of that without the username and password. Our workaround became to use the IPv4 addressing instead. So I am closing this and will after-the-fact inform when we test the workaround.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/BookStack#3338