You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
because although the root password is blank, it still needs to be specified.
At least, it is my experience (in this script and in a devbox shell) that --password='' (or just -p) needs to be given. It must have worked for the original author without --password=''. I don't know why. Perhaps it's because I'm running as non-root? Perhaps mysqld initialize-insecure changed? Anyway.
Problem 2: too-long socket file paths
Yes, I read the README, but let's spell it out:
Say I try to run MySQL in a shell, rather than through test_db_setup:
cd /tmp/mysqltest # Created above with 'devbox create mysqltest --template mysql'
devbox services up -b
devbox shell
mysql -u root -p
This works for me.
But if I have the same project in a longer path:
cd ~/src/github.com/jetify-com/devbox/examples/databases/mysql # source from git
devbox shell
devbox services up -b
mysqld fails with:
...
[mysql_logs ] 2025-02-17T04:15:07.646616Z 0 [ERROR] [MY-010267] [Server] The socket file path is too long (> 107): /home/jturner/src/github.com/jetify-com/devbox/examples/databases/mysql/.devbox/virtenv/mysql80/run/mysql.sock
[mysql_logs ] 2025-02-17T04:15:07.646655Z 0 [ERROR] [MY-010119] [Server] Aborting
[mysql_logs ] 2025-02-17T04:15:08.686569Z 0 [System] [MY-010910] [Server] /home/jturner/src/github.com/jetify-com/devbox/examples/databases/mysql/.devbox/nix/profile/default/bin/mysqld: Shutdown complete (mysqld 8.0.36) Source distribution.
The problem is that MYSQL_UNIX_PORT is too long, as the README notes, and the fix is to define MYSQL_UNIX_PORT in an env section, as the README notes:
So why not just do it in the example app's devbox.json? Every real project is going to have to change MYSQL_UNIX_PORT in this way, because having one's app break depending on where it runs is ridiculous, so surely the 'template' should? I mean, MYSQL_UNIX_PORT is already hardcoded in test_db_setup - just needs to become an env variable:
path rather than plugin's project-relative path, to avoid triggering
'The socket file path is too long (> 107)' error on start. Also specify
the (blank) password in 'test_db_setup'. Fixesjetify-com#2521
jefft
added a commit
to jefft/devbox
that referenced
this issue
Feb 17, 2025
path rather than plugin's project-relative path, to avoid triggering
'The socket file path is too long (> 107)' error on start. Also specify
the (blank) password in 'test_db_setup'. Fixesjetify-com#2521
What happened?
First, thanks for creating devbox! It's already a useful project with amazing potential.
I'm trying to get MySQL running, and although the database runs, the template experience is a bit sad.
There are two technically distinct problems, whose fixes overlap, so I'm describing them both in this bug. I'll link a PR too.
Missing password in
test_db_setup
commandIf I run:
the final output is:
For reference, here is
devbox.json
:The problem with
test_db_setup
is on the line:mysql -u root < setup_db.sql
It should be:
because although the root password is blank, it still needs to be specified.
At least, it is my experience (in this script and in a devbox shell) that
--password=''
(or just-p
) needs to be given. It must have worked for the original author without--password=''
. I don't know why. Perhaps it's because I'm running as non-root? Perhapsmysqld initialize-insecure
changed? Anyway.Problem 2: too-long socket file paths
Yes, I read the README, but let's spell it out:
Say I try to run MySQL in a shell, rather than through
test_db_setup
:This works for me.
But if I have the same project in a longer path:
mysqld fails with:
The problem is that
MYSQL_UNIX_PORT
is too long, as the README notes, and the fix is to defineMYSQL_UNIX_PORT
in an env section, as the README notes:So why not just do it in the example app's devbox.json? Every real project is going to have to change
MYSQL_UNIX_PORT
in this way, because having one's app break depending on where it runs is ridiculous, so surely the 'template' should? I mean, MYSQL_UNIX_PORT is already hardcoded intest_db_setup
- just needs to become an env variable:With these changes, this works:
as does:
Steps to reproduce
Command
No response
devbox.json
Devbox version
0.14.0
Nix version
nix (Nix) 2.18.5
What system does this bug occur on?
Linux (x86-64)
Debug logs
No response
The text was updated successfully, but these errors were encountered: