question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Message header lost on commit error

See original GitHub issue

Summary

When you try to commit a migration which has a --! Message: header in current.sql, and that migration fails for some reason, e.g. syntax error, current.sql is restored, but the --! Message: is lost.

Steps to reproduce

Have contents of current.sql as such:

--! Message: test-migration

DROP TABLE IF EXISTS app_public.table_name CASCADE;
CREATE TABLE app_public.table_name(
  id TEXT PRIMARY KEY,
  title TEXT, --this comma causes an error
);

run the commit command and get an error like this: image

Expected results

Have contents of current.sql the same as before failure:

--! Message: test-migration

DROP TABLE IF EXISTS app_public.table_name CASCADE;
CREATE TABLE app_public.table_name(
  id TEXT PRIMARY KEY,
  title TEXT, --this comma causes an error
);

Actual results

Actual contents of current.sql are missing the header:

DROP TABLE IF EXISTS app_public.table_name CASCADE;
CREATE TABLE app_public.table_name(
  id TEXT PRIMARY KEY,
  title TEXT, --this comma causes an error
);

Additional context

graphile-migrate version 1.0.2.

Possible Solution

Since there is a log before that like

graphile-migrate[shadow]: Running migration '000002-test-migration.sql'

It should be possible to get the message value at least from filename.

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
PizzaPartyInccommented, May 24, 2021

Thanks for the heads up! It might also take a while for me to free some time, but it’s not a big inconvenience, so totally fine for it to wait 😃

0reactions
benjiecommented, Jun 28, 2021

Sure 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Git repository corrupt (incorrect header check; loose object is ...
It appears that git created files in .git/objects for the new commit, but didn't successfully write to them. I solved it by deleting...
Read more >
Can't commit - "Waiting for Emacs... *ERROR*: BUG ... - GitHub
*ERROR*: BUG: missing headers" #3754 ... However now when I try to commit, Emacs waits for a moment and then I get message:...
Read more >
Why is orignal message header is lost in Outlook replies?
Recently, original message header is lost when replying or forwarding emails in some Outlook mails. It is strange that some emails retain the...
Read more >
[Junos Platform] Commit failure due to missing file or directory
When a file or directory is missing, users receive an error message and command commit fails. This article describes how to rebuild a...
Read more >
git-commit Documentation - Git
It is an error for the "amend!" commit's log message to be empty unless --allow-empty-message is specified. --fixup=reword:<commit> is shorthand for --fixup= ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found