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
Fix: Knex CLI calls process.chdir() before opening Knexfile #3661
Fix: Knex CLI calls process.chdir() before opening Knexfile #3661
Conversation
Wasn't your preferred approach not to change process directory altogether? |
@kibertoad : It is; however, it looks like that is going to take a bit of work. It looks like several modules within Knex are implicitly coupled with In the meantime, the current PR at least fixes this specific regression. (But yeah -- arguably, the Knexfile itself should not be calculating paths relative to |
@kibertoad : Hmm... the Travis CI failure seems to be an unrelated transaction failure. Is there an easy way to kick off the job again? |
... this was mostly to kick off another Travis CI build since the previous one seems to have failed randomly.
Thanks! I'll publish version with hotfix in the evening. |
@kibertoad : Thx! And yeah, I'll look into the "decouple the code from |
Sorry, there will be a delay in releasing new version, there is a possible regression in timeout code that need investigation :-/ |
np! |
@kibertoad : In terms of the timeouts, are you referring to the latest Travis-CI failure? https://travis-ci.org/knex/knex/jobs/650139383?utm_medium=notification&utm_source=github_status If so, I noticed that error recently as well. It seems to be one of those fun "random" errors... |
@kibertoad : I think I've tracked down at least part of the problem. Take a look at the following: Lines 259 to 265 in 77df705
Suppose that |
@maximelkin thoughts on explanation above? |
Addresses the issue outlined here:
#3660
Short story: the Knex CLI was opening the Knexfile before calling
process.chdir(...)
. Unfortunately, the Knexfile in question was resolving some paths relative toprocess.cwd()
. As a result, these paths ended up being relative to the wrong directory.