-
Notifications
You must be signed in to change notification settings - Fork 56
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
Diesel migration run fails with "error applying hunk #1" #299
Comments
Hi, @sotcsa thanks for raising this. Were you able to work around the issue? If you did, please feel free to submit a request. Meanwhile, we will put this on our backlog. |
@sotcsa hey there! Could you tell me what version of PostgreSQL do you use? FYI, I've tried to apply the migrations on the newly created database locally and couldn't reproduce the bug. I am using PostgreSQL 14.4
|
Hi @khorolets PostgreSQL 12.12 (Ubuntu 12.12-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0, 64-bit |
I can't identify a problem as I cannot reproduce it. Could you try to apply that failing migration manually by just copying the SQL query from the up.sql file directly to your database and see if there is any useful error cc @telezhnaya |
@sotcsa The error "error applying hunk #1" does not look like one Postgres could return. It sounds like |
I am also facing the same problem. |
Migration looks good. Please copy-paste the SQL, run it manually, and provide the error here. |
I got the same error on the lastest migration |
Maybe the problem comes from the different ways of testing. On my first message I added hoow I did it from scratch - and can't see anytime working:
|
I have the same problem OS: ubuntu 20.04 |
@sundafa The issue you report seems to be completely different one. Try fresh checkout from master as our CI passes just fine. |
That issue is the very same, if I don't stop at the first error, got the same result with the cargo build. Team, could you describe please how you tested it whether it's working or not? Do you use a fresh DB and clean checkout? |
I tried to pull a fresh copy of the master branch and used docker postgres:latest. I confirm the same issue. Tested on two platforms Ubuntu 22 and Mac OS M1 Step followed
|
Just an update, I saw that when I try to run A temporary workaround
|
Hi. I receive
If I try to run commands, stored in migrations/2022-08-12-123800_ft_nft_indexes/up.sql Then I receiving these errors:
|
Does anyone from the community have time to look into why diesel CLI leads us into this problem state? It seems to be not reproducible on our end 🤔 |
Encountered this error today, seemed like diesel issue [1]. Installing version 1.2 of diesel fixed this issue for me. |
Facing the same issue on diesel-cli
|
For me, errors like this are triggered not by migrations, but by having a diesel.toml file that excludes certain tables. But I can trigger it without any migrations by doing I can also turn it off by commenting out the patch_file command. So yeah, I guess it's a conflict between the altered schema and the patch file. |
I have tried to build the indexer - following the steps:
git clone [email protected]:near/near-indexer-for-explorer.git
cd near-indexer-for-explorer
echo "DATABASE_URL=postgres://xxx:yyy@zzzz/dbdbdbd" > .env
cargo install diesel_cli --no-default-features --features "postgres"
diesel migration run
With the latest master commit, diesel migration run fails:
Running migration 2021-10-04-100000_assets_nft
Running migration 2021-10-14-180948_add_resharding_state_change_reason_kind
Running migration 2022-01-12-100000_assets_ft
Running migration 2022-01-26-184200_drop_duplicated_index_execution_outcome
Running migration 2022-01-26-184201_index_action_receipt_actions
Running migration 2022-06-07-000000_drop_action_receipt_actions_args_amount_index
Running migration 2022-08-12-123800_ft_nft_indexes
error applying hunk #1
Versions:
OS: Ubuntu 20.04.5 LTS
diesel 2.0.0
rustc 1.63.0 (4b91a6ea7 2022-08-08)
The text was updated successfully, but these errors were encountered: