Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

error: terminating connection due to administrator command

default discord avatar
generator1012 years ago
14

hi everyone,


I constantly get this error:



node_modules/pg-protocol/src/parser.ts:369


name === 'notice' ? new NoticeMessage(length, messageValue) : new DatabaseError(messageValue, length, name)


^


error: terminating connection due to administrator command



I am using postgres , and I have to restart the server every time, any idea why this is happening?

  • default discord avatar
    lioloc2 years ago

    I haven't encountered this personally, what are the steps to reproduce? What's your payload version?

  • default discord avatar
    generator1012 years ago

    I am using

    "payload": "2.6.0",

    and also

    https://neon.tech/

    for the postgres



    constantly crashes



    node_modules/pg-protocol/src/parser.ts:369
          name === 'notice' ? new NoticeMessage(length, messageValue) : new DatabaseError(messageValue, length, name)
                                                                        ^
    error: terminating connection due to administrator command
        at Parser.parseErrorMessage (node_modules/pg-protocol/src/parser.ts:369:69)
        at Parser.handlePacket (node_modules/pg-protocol/src/parser.ts:188:21)
        at Parser.parse (node_modules/pg-protocol/src/parser.ts:103:30)
        at TLSSocket.<anonymous> (node_modules/pg-protocol/src/index.ts:7:48)
        at TLSSocket.emit (node:events:514:28)
        at TLSSocket.emit (node:domain:489:12)
        at addChunk (node:internal/streams/readable:324:12)
        at readableAddChunk (node:internal/streams/readable:297:9)
        at TLSSocket.Readable.push (node:internal/streams/readable:234:10)
        at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {
      length: 116,
      severity: 'FATAL',
      code: '57P01',
      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: '3261',
      routine: 'ProcessInterrupts'
    }
    [nodemon] app crashed - waiting for file changes before starting...


    any help with this one?I want to use postgres as it will make it much easier for me to update the data manually



    but site constantly fails with this error

  • default discord avatar
    notchr2 years ago

    Can you provide any more information from your instance? I've seen this error before when there were connectivity issues

  • default discord avatar
    generator1012 years ago

    do you think it is related to

    https://neon.tech/

    ? I followed the docs for migrating mongodb to postgres, it was pretty simple

  • default discord avatar
    notchr2 years ago

    Well, it's possible



    According to neon,

    The terminating connection due to administrator command error is typically encountered when running a query from a connection that has sat idle long enough for the compute endpoint to suspend due to inactivity. Neon automatically suspends a compute endpoint after 5 minutes of inactivity, by default.

    So it could be that you made a request that issues a query on an idle connection?



    I'd have to look more into it, though I think

    @858693520012476436

    would find this interesting

  • default discord avatar
    paulpopus2 years ago

    Yeah we've seen this, it will happen with Vercel as well who uses neon.tech under the hood, we don't currently have a way of managing this connection being terminated

  • default discord avatar
    generator1012 years ago

    is there any other recommendation services for cloud postgres?

  • default discord avatar
    paulpopus2 years ago

    We want to fix this for sure, in the meantime supabase or digitalocean are good options for managed databases

  • default discord avatar
    philitician2 years ago

    We have also run into this issue after switching from Supabase to Neon, as Neon has stable support for branching and integrates well with Vercel.



    Has there been made any advances on handling the issue with Payload crashing due to automatic compute suspension? I guess in the meantime as a temporary fix we could set up a scheduled task to ping neon periodically by hitting a payload Collection endpoint.



    If there is not fix yet, do you think the automatic suspension will crash the future release of Payload running on Nextjs runtime?

  • default discord avatar
    paulpopus2 years ago
    @969226489549713438

    would know better on the status of this issue

  • discord user avatar
    dribbens
    2 years ago

    I didn't see this community help issue until now. This is a perfect thing to open a GitHub issue for. We can address this by trying to reconnect automatically. I can work on this.

    @944284724824801302

    can you please open an issue on GitHub for us to track this?

  • default discord avatar
    joetforhire2 years ago

    having this same problem.

    @969226489549713438

    I made an issue here as it appears there wasn't one:

    https://github.com/payloadcms/payload/issues/5075

    hey hey, thanks for the work i saw a fix was merged. is this good to go?

    https://github.com/payloadcms/payload/pull/5086

    i updated my payload to

    "payload": "^2.11.1"

    but i'm still getting the same disconnect


    [23:27:37] INFO (payload): Payload Admin URL: /admin
    node:events:491
          throw er; // Unhandled 'error' event
          ^
    error: terminating connection due to administrator command
        at Parser.parseErrorMessage (/home/node/app/node_modules/pg-protocol/dist/parser.js:287:98)
        at Parser.handlePacket (/home/node/app/node_modules/pg-protocol/dist/parser.js:126:29)
        at Parser.parse (/home/node/app/node_modules/pg-protocol/dist/parser.js:39:38)
        at TLSSocket.<anonymous> (/home/node/app/node_modules/pg-protocol/dist/index.js:11:42)
        at TLSSocket.emit (node:events:513:28)
        at addChunk (node:internal/streams/readable:324:12)
        at readableAddChunk (node:internal/streams/readable:297:9)
        at Readable.push (node:internal/streams/readable:234:10)
        at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)
    Emitted 'error' event on Client instance at:
        at Client._handleErrorEvent (/home/node/app/node_modules/pg/lib/client.js:341:10)
        at Client._handleErrorMessage (/home/node/app/node_modules/pg/lib/client.js:352:12)
        at Connection.emit (node:events:513:28)
        at /home/node/app/node_modules/pg/lib/connection.js:117:12
        at Parser.parse (/home/node/app/node_modules/pg-protocol/dist/parser.js:40:17)
        at TLSSocket.<anonymous> (/home/node/app/node_modules/pg-protocol/dist/index.js:11:42)
        [... lines matching original stack trace ...]
        at Readable.push (node:internal/streams/readable:234:10) {
      length: 116,
      severity: 'FATAL',
      code: '57P01',
     // ...
    
    Node.js v18.8.0


    wonder what im missin. the neon.tech db is all default on main branch

  • default discord avatar
    paulpopus2 years ago

    did you update the postgres package as well?



    it needs to be updated separately



    these fixes would only be in there

  • default discord avatar
    joetforhire2 years ago

    ah of course, did that and it works perfectly. thanks

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.