`psql` outputs it's `NOTICE` messages to stderr causing the action to fail
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 42/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- postgresql, typescript
Research direction
Read src/PsqlFilesExecutor.ts at the linked lines to trace how psql stderr and its exit code are handled. Reproduce the migration scenario described in the issue, then verify that NOTICE output no longer fails the action while genuine psql failures still do.
Written by the indexing model from the issue text.
Description
psql outputs it's NOTICE messages to stderr causing the whole action to fail even if the exit code is 0.
The offending lines of code:
https://github.com/Azure/postgresql/blob/f82d2b25075a9092d3ee987db9c77bcfc43fc6bc/src/PsqlFilesExecutor.ts#L27-L33
https://github.com/Azure/postgresql/blob/f82d2b25075a9092d3ee987db9c77bcfc43fc6bc/src/PsqlFilesExecutor.ts#L38-L40
NOTICE's should be treated as warnings not errors those would be EXCEPTION's.
Maybe there should be an option for choosing to ignore stderr and instead rely on the exit code of psql
It's trivial to get a NOTICE to fail the action.
Consider the following output generated by dotnet ef migrations script -s Proj.Bootstrap -p Proj.Data --idempotent -o migration.sql:
CREATE TABLE IF NOT EXISTS "__EFMigrationsHistory" (
"MigrationId" character varying(150) NOT NULL,
"ProductVersion" character varying(32) NOT NULL,
CONSTRAINT "PK___EFMigrationsHistory" PRIMARY KEY ("MigrationId")
);
START TRANSACTION;
....
COMMIT;
If the __EFMigrationsHistory table already exists, the action fails, because psql:/migration.sql:5: NOTICE: relation "__EFMigrationsHistory" already exists, skipping gets written to stderr.
- Dominant language
- TypeScript
- Stars
- 25
- Forks
- 22
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Azure/postgresql
-
need-to-triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Azure/postgresql#58 ·
-
need-to-triage
Difficulty 3/5 1-2 days Newbie friendliness 35/100
Azure/postgresql#55 ·
-
need-to-triage
Difficulty 5/5 Over a week Newbie friendliness 20/100
Azure/postgresql#53 · 1 comment ·
-
need-to-triage
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Azure/postgresql#52 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Azure/postgresql#48 · 2 comments · 2 reactions ·
All issues in Azure/postgresql
Similar issues
-
VerificationGate: ATTRIBUTION quote guard never matches a normal quotation (\b around the quote) Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
danielmiessler/LifeOS#2234 ·
-
T: Bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Mend: dependency security vulnerability untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 70/100