-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
file does not exist error #35
Comments
The |
The output of
As I said, maybe I just don't understand what the argument |
This is the full command: |
Did you create the migration files using |
I have the same issue.
I try to run following command from the 'root-of-project': |
@kostyaVyrodov what's the full error message? e.g. does it start with |
@dhui , By the way, I noticed that I use https://github.com/mattes/migrate v.3.0.1 instead of your fork. Maybe there is no such issue with your library. I just inattentive and missed that this repo is a fork of the library... Sorry :) |
@kostyaVyrodov Try using this repo's CLI but I don't expect a difference since the |
Am also getting this issue - anyone figure out the cause? |
Hello, Steps to reproduce:
|
I had the exact problem, rebuilding the cli binary with adding
What baffles me is after that I tried to rebuild the binary again without the EDIT: |
The file source is automatically built with the CLI (it's imported in cli/commands.go). For re-building using the Is everyone using Go 1.9.x or 1.10.x? Also, since v3.3.0, you can see the source and db drivers that are loaded in the help text. |
We have the same error. It worked once, then when we try to run it again (nothing changed), files present and correct, correct path etc. we get "Error: File does not exist" This means we can no longer update our production system. |
Maybe as a start that error could indicate what file it is looking for?
somehow when you go all the way down it introduces a version |
@francisdb Not sure how |
|
Hi. Have same issue with clickhouse only. postgres is ok. I'm using cli. |
Any updates on this? I've been experiencing this for the past few days and the only solution for me was to nuke the db and repopulate everything from scratch for it to work correctly. I'm just fortunate as that particular db was part of a new application deployment but I can see issues arising when trying to update db versions...It seems like @slax0rr might be right about the cause, as I experienced the error mostly as he described in his steps to reproduce:
|
Removing the migration file referenced by the schema_migration table (or whatever your specific DB driver uses) will cause this error. Modifying/replacing the migration file won't work without forcing the schema version to the previous version using |
I started debugging a similar issue.
Everything seems good, checking
but
Looking at the code for some reason we return I don't understand the intent of |
@n1koo Your issue is slightly different as you're running The standard usage is to use However, you have the option to use |
Hello, I too am getting this error when trying to do dry runs of migrations against a new PostgreSQL instance running in a CI pipeline: error: first /migrations/: file does not exist The pipeline starts an instance of Postgres then does the following command: docker run -v /database/src:/migrations --network host migrate/migrate -path=/migrations/ -database postgres://postgres:integration@localhost:5432/postgres?sslmode=disable up The current working directory is set to
Is there some initialization command I need to be running first? |
@davidsbond What's |
Looks like the issue must be down to how the docker volume is being set, although I don't think I'm setting it incorrectly. Will keep digging Here's the output of
|
@dhui Apprently my CI provider doesn't support mounting files this way, I'll have to change the pipeline to use the CLI directly instead! |
I found myself with the same problem today I managed to get around the issue by |
Are people still hitting this issue with migrate v4.3.1? |
Any update? |
@dhui Simply run this docker compose file with some sql migration files in
|
@haskaalo try |
@dhui Just tried, it doesn't work :/ |
I ran into this in 4.6.1 when trying to use two different migrations sources on the same db. Had to rename schema_migrations for this to work. |
just need to add migration table name config variable. This will allow to run multiple migrations on same database. |
I ran into this today when I tried to migrate a file named Since the regex for a legit migration is @dhui would you be open to a PR to adjust that regex to include or possibly to modify the error message to reference the applicable regex? Thanks much for the fine work on |
I'm running into the problem is I'm running the migrations function from my |
Instead of returning a file not found error when no more changes are available, return a no change message. Fixes golang-migrate#35 Fixes golang-migrate#312
Instead of returning a file not found error when no more changes are available, return a no change message. Fixes golang-migrate#35 Fixes golang-migrate#312
Any update on this? I'm trying to run this via the CLI and also docker-compose. the command doesn't work in either environments. If it helps, I'm on a macOS running the latest version of golang-migrate. Directory Structure:
Via CLI:
Returns docker-compose.yml
Container returns Any input would be great! |
As @dhui suggested, I've tried putting Is there a way to pause the migrate container so I can shell in and verify if the files are getting copied or not? |
I got it working! The issue was on my part, I had named the sql files incorrectly:
If anyone needs a working Sorry for the noise! |
@jonleopard would you mind sharing your |
Here is my
|
@ashtonian I am also facing the same issue while trying to have two sets of migrations under same database. But if you rename the |
thanks @jkonarze , this worked for me as well. |
remover query param in string database |
works for me,tanks |
This fixed the issue |
This really was the key for me, I had named the files incorrectly all this time, thanks so much! |
Worked for me 🥂❤️ |
In case you try to run |
I'm trying to run the migrations with
migrate -path $filepath -database postgres://postgres:password@db:5432/dev?sslmode=disable up
where$filepath
is a path to my sql files. The contents are1526653772_init_down.sql
and1526653772_init_up.sql
. But it's saying "file does not exist". It's not a file, I know, it's a directory where my sql files are stored, as noted in #9. Is this not the proper argument anymore? if so, what is? what does the path argument describe?The text was updated successfully, but these errors were encountered: