Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: start-database.sh password generation doesn't work on Arch Linux #2099

Open
calthejuggler opened this issue Apr 5, 2025 · 2 comments · May be fixed by #2100
Open

bug: start-database.sh password generation doesn't work on Arch Linux #2099

calthejuggler opened this issue Apr 5, 2025 · 2 comments · May be fixed by #2100

Comments

@calthejuggler
Copy link

Provide environment information

System:
    OS: Linux 6.13 Arch Linux
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 3.41 GB / 7.52 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 11.1.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
    pnpm: 9.15.3 - ~/.nvm/versions/node/v22.11.0/bin/pnpm
    bun: 1.2.3 - ~/.bun/bin/bun

Describe the bug

Hey there! When I run the start-database.sh script on any new project in Arch Linux, if I choose to have the password generated for me, the sed command fails with:

awk: warning: escape sequence `\/' treated as plain `/'
You are using the default database password
Should we generate a random password for you? [y/N]: y
sed: can't read s#:password@#:w4ifElw2OcxMb2QY@#: No such file or directory
d5013a5f8bfa394f8eeb0646ab1febb90b3011ea0eca20e4fda1a7944094758a
Database container 'db_name-postgres' was successfully created

The database starts with the correct name and password, but the password isn't filled in the .env file, so I need to manually copy and paste it in from this sed command.

I believe this is caused by the empty string '' in the command which is apparently required in MacOS, but not in Linux, so it thinks the replacement string is the name of the file.

Happy to put in a PR with an attempted fix, although somebody will most likely need to test it for me on Mac to be sure I don't break it for those users 😅

Hope to hear from you soon! Thanks 🙂

Reproduction repo

https://github.com/t3-oss/create-t3-app

To reproduce

Create a new t3 app on Arch Linux. Run the commands at the end in order until ./start-database.sh. Run that script and choose Yes when asked if you want a password generated for you. The db is started with the generated password, but the .env file is not populated with it.

Additional information

No response

@calthejuggler
Copy link
Author

Whilst putting a PR together for this, I also realise the MySQL script names the container -postgres 😅 Will add a fix for that too

@calthejuggler calthejuggler linked a pull request Apr 5, 2025 that will close this issue
3 tasks
@calthejuggler
Copy link
Author

Oh, I totally duplicated #2088 😬

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant