-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
[Snyk] Upgrade pg-promise from 10.9.2 to 10.10.1 #7286
[Snyk] Upgrade pg-promise from 10.9.2 to 10.10.1 #7286
Conversation
Snyk has created this PR to upgrade pg-promise from 10.9.2 to 10.9.3. See this package in npm: https://www.npmjs.com/package/pg-promise See this project in Snyk: https://app.snyk.io/org/acinader/project/8c1a9edb-c8f5-4dc1-b221-4d6030a323eb?utm_source=github&utm_medium=upgrade-pr
Danger run resulted in 1 fail and 1 markdown; to find out more, see the checks page. Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #7286 +/- ##
==========================================
- Coverage 93.92% 93.91% -0.02%
==========================================
Files 179 181 +2
Lines 13153 13194 +41
==========================================
+ Hits 12354 12391 +37
- Misses 799 803 +4
Continue to review full report at Codecov.
|
@vitaly-t Do you have any suggestions before I dig in on the failing test? |
@dplewis There was a change that looks related, but I didn't expect it to break anything. Other than that, not sure what's going on. If you find the exact test that's now failing, I will look into it. |
@dplewis Unfortunately, this doesn't tell me enough. You see, you do not really use If you can be give me an isolated (without parse-server code) test that just uses Again, this is likely somehow related to #774. |
I’ll give it a go. You wrote most of the transaction code here so I at least have something to work on. Do you have documentation on savepoints? |
I didn't, I only refactored them.
Issue #744 has most of it. Plus the official docs. |
Note that there are two test that are failing with the update. One of them just looks like it passes: parse-server/spec/PostgresStorageAdapter.spec.js Lines 27 to 64 in 3638b0e
with error: BatchError {
stat: { total: 18, succeeded: 1, failed: 17, duration: 143 }
errors: [
1: error: savepoint "sp_1_2" does not exist
at Parser.parseErrorMessage (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/index.js:10:42)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) {
length: 93,
severity: 'ERROR',
code: '3B001',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'xact.c',
line: '4167',
routine: 'ReleaseSavepoint'
}
10: error: current transaction is aborted, commands ignored until end of transaction block
at Parser.parseErrorMessage (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/index.js:10:42)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) {
length: 144,
severity: 'ERROR',
code: '25P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'postgres.c',
line: '1101',
routine: 'exec_simple_query'
}
11: error: current transaction is aborted, commands ignored until end of transaction block
at Parser.parseErrorMessage (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/index.js:10:42)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) {
length: 144,
severity: 'ERROR',
code: '25P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'postgres.c',
line: '1101',
routine: 'exec_simple_query'
}
12: error: current transaction is aborted, commands ignored until end of transaction block
at Parser.parseErrorMessage (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/index.js:10:42)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) {
length: 144,
severity: 'ERROR',
code: '25P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'postgres.c',
line: '1101',
routine: 'exec_simple_query'
}
13: error: current transaction is aborted, commands ignored until end of transaction block
at Parser.parseErrorMessage (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/index.js:10:42)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) {
length: 144,
severity: 'ERROR',
code: '25P02',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'postgres.c',
line: '1101',
routine: 'exec_simple_query'
}
]
} and parse-server/spec/PostgresStorageAdapter.spec.js Lines 99 to 125 in 3638b0e
with error: 1) PostgresStorageAdapter Create a table without columns and upgrade with columns
Message:
Failed: savepoint "sp_1_2" does not exist
Stack:
error properties: BatchError {
stat: { total: 2, succeeded: 1, failed: 1, duration: 21 }
errors: [
1: error: savepoint "sp_1_2" does not exist
at Parser.parseErrorMessage (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket.<anonymous> (/Users/coreybaker/Documents/github/parse-server/node_modules/pg-protocol/dist/index.js:10:42)
at Socket.emit (node:events:376:20)
at addChunk (node:internal/streams/readable:304:12)
at readableAddChunk (node:internal/streams/readable:279:9)
at Socket.Readable.push (node:internal/streams/readable:218:10)
at TCP.onStreamRead (node:internal/stream_base_commons:192:23) ... ...
at <Jasmine>
at check (/Users/coreybaker/Documents/github/parse-server/node_modules/spex/lib/ext/batch.js:135:32)
at step (/Users/coreybaker/Documents/github/parse-server/node_modules/spex/lib/ext/batch.js:109:17)
at /Users/coreybaker/Documents/github/parse-server/node_modules/spex/lib/ext/batch.js:83:17
at /Users/coreybaker/Documents/github/parse-server/node_modules/spex/lib/utils/index.js:62:25
at processTicksAndRejections (node:internal/process/task_queues:93:5) |
Is that an issue with I asked before to create an isolated test for |
I'm not sure if it's pg-promise or the parse-server. There were also some changes to PostgresStorageAdapter.js and PostgresStorageAdapter.spec.js that could have introduced this or it could have always been doing something wrong like you mentioned. |
@dplewis Any luck reproducing the issue via |
@vitaly-t I haven't had time to look into yet. I'll try to get to it this week. |
@vitaly-t I realized while working on #7283 that in Parse Server we are mixing the use of transactions and tasks. In the example below instead of
|
I can see the issue there, |
@cbaker6 How does this look? |
@dplewis I still want to get to the bottom of it. I'm not convinced it was an issue here either. Will need to run some tests on my end. |
@vitaly-t I want to as well. Let me know if there is anything I can do to help. |
@vitaly-t I ran the following and got the error. vitaly-t/pg-promise@master...dplewis:savepoint-test
|
@vitaly-t I opened a PR vitaly-t/pg-promise#784 Lets continue the conversation there |
Thank you guys for your assistance in this matter. I have done my analysis of this issue, and posted details within this PR. If anymore changes are needed, they would be within i.e. the only correct way to write such code: await db.tx(async t => {
const a = await t.tx(t1 => { });
const b = await t.tx(t1 => { });
const c = await t.tx(t1 => { });
return {a, b, c}; // or return [a, b, c], if needed
}); The above approach makes sure the savepoints of the same parent transaction do not end up clashing because of asynchronous execution. As per my notes, recent changes in i.e. we did not create problems recently, we have revealed there have been problems all along, and we just did not know about them. |
🎉 This change has been released in version 5.0.0-beta.1 |
🎉 This change has been released in version 5.0.0 |
Snyk has created this PR to upgrade pg-promise from 10.9.2 to 10.9.3.
ℹ️ Keep your dependencies up-to-date. This makes it easier to fix existing vulnerabilities and to more quickly identify and fix newly disclosed vulnerabilities when they affect your project.
Release notes
Package name: pg-promise
sp_x_y
form. See Transaction Limitations.Commit messages
Package name: pg-promise
Compare
Note: You are seeing this because you or someone else with access to this repository has authorized Snyk to open upgrade PRs.
For more information:

🧐 View latest project report
🛠 Adjust upgrade PR settings
🔕 Ignore this dependency or unsubscribe from future upgrade PRs