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

MacOS: migrateci cant find shell command "mysqldump" #56

Closed
okaluk opened this issue Jun 8, 2024 · 7 comments · Fixed by #58
Closed

MacOS: migrateci cant find shell command "mysqldump" #56

okaluk opened this issue Jun 8, 2024 · 7 comments · Fixed by #58

Comments

@okaluk
Copy link

okaluk commented Jun 8, 2024

Hello,

im working on a mac and the project im working on uses "migrateci" to build local test databases, which get dumped/cached to be able to load them later on.

when investigating a bug, i used git bisect to run migrateci over many commits. all of them failed on the end, when "mysqldump" is used inside a shell that is opened from python. since i cant define which shell it is loading, and the "paths" are configured in my user profile, it cant find mysqldump. i even tried adding /usr/local/bin to the /etc/paths file to fix this problem, but it didnt work.

i am not very "skilled" and capable of understanding the problems, but what i see is that the shell opened by migrateci does not have the path to mysqldump.

maybe someone can help me with that issue.

the following error is what i get:

django_migrations_ci.shell.MigrateCIShellException: /bin/sh: mysqldump: command not found

i could fix that problem temporarely:

since mysqldump is part of the mysql package which is installed via brew on my system, root doesnt know the binary "mysqldump".

to fix that, i created a symlink in /usr/local/bin to the mysqldump binary file.

that solved it.

@iurisilvio
Copy link
Collaborator

Interesting, I probably want a config path to each command (mysqldump/pg_dump/sqlite), because I can't trust we'll always have them globally available.

I'll try to make it soon.

@iurisilvio
Copy link
Collaborator

Ah I see I don't pass PATH to the subprocess, should be enough to follow your system config.

@iurisilvio
Copy link
Collaborator

iurisilvio commented Jul 21, 2024

@maj1n167 Any chance you test your case using PR #58? I expect it to work if your PATH is properly configured.

@okaluk
Copy link
Author

okaluk commented Jul 21, 2024

i can test this sure. i will inform you when i did.

@iurisilvio
Copy link
Collaborator

If for some reason it doesn't work, you have to add the mysqldump path to PATH env variable. I think this is a better solution than a custom env var.

@okaluk
Copy link
Author

okaluk commented Jul 24, 2024

first i created an environment, where the the error is persistent.

my PATH is already properly configured. since homebrew installs it correctly.

i patched the package as its shown in PR #58

afterwards i restarted migrateci:

image

it worked for me. i would say that PR #58 fixes the issue, thank you !

@iurisilvio
Copy link
Collaborator

Thanks for the test! I merged and released v0.10.1 now. 🎉

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

Successfully merging a pull request may close this issue.

2 participants