Skip to content
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

heroku pg:pull stopped working #2563

Closed
celsoMartins opened this issue Nov 28, 2023 · 16 comments
Closed

heroku pg:pull stopped working #2563

celsoMartins opened this issue Nov 28, 2023 · 16 comments

Comments

@celsoMartins
Copy link

HI.

This week the heroku pg:pull command stopped working and it returns:

heroku-cli: Pulling postgresql-metric-35199 ---> aposta10_development
pg_dump: error: connection to server at "ec2-54-160-95-35.compute-1.amazonaws.com" (54.160.95.35), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet
connection to server at "ec2-54-160-95-35.compute-1.amazonaws.com" (54.160.95.35), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet
pg_restore: error: could not read from input file: end of file
 ▸    pg_dump errored with 1

I'm using the latest MacOS and it has been working well until this week. If a new credential is required now, where do I have to add it?

I'll appreciate any help.

Thanks.

@k80bowman
Copy link
Contributor

@celsoMartins this seems like more of an account problem rather than a CLI problem. I would recommend reaching out to Heroku support.

@celsoMartins
Copy link
Author

Ok then.

But I am able to do everything on Heroku's page and I can still connect to heroku pg:backups

Anyway, I'll reach them. Thank you.

@brettchalupa
Copy link

brettchalupa commented Nov 28, 2023

I have started to get a similar issue with the pg:psql command. Here are my details:

$ heroku pg:psql -a MYAPP
--> Connecting to MYAPP-postgresql
psql: error: connection to server at "ec2-ABC123.compute-1.amazonaws.com" (ABC123), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet
connection to server at "ec2-3-217-62-59.compute-1.amazonaws.com" (ABC123), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet
 ▸    psql exited with code 2

and my heroku CLI version:

$ heroku -v
heroku/8.7.1 darwin-x64 node-v16.19.0

I confirmed that my account has access to the app and database and that other heroku commands work, like heroku run

I'm on MacOS 13.6.1.

@k80bowman
Copy link
Contributor

Thank you for providing some further information. We'll look into it on our end as well.

@jmarsh24
Copy link

jmarsh24 commented Dec 1, 2023

I'm also experiencing this issue.

pg_dump: error: connection to server at "ec2-52-211-232-23.eu-west-1.compute.amazonaws.com" (52.211.232.23), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet
connection to server at "ec2-52-211-232-23.eu-west-1.compute.amazonaws.com" (52.211.232.23), port 5432 failed: FATAL:  no PostgreSQL user name specified in startup packet
pg_dump(82827,0x1e3a99ec0) malloc: double free for ptr 0x13f00c200
pg_dump(82827,0x1e3a99ec0) malloc: *** set a breakpoint in malloc_error_break to debug
pg_restore: error: could not read from input file: end of file
 ▸    pg_restore errored with 1
❯ heroku -v
heroku/8.7.1 darwin-arm64 node-v16.19.0

Mac OS Sonoma 14.1.1

@k80bowman
Copy link
Contributor

I'm working on debugging this, but if a couple of you who are experiencing this issue could answer a few questions for me, I would appreciate it.

  1. Do you have any environment variables set that start with PG or PSQL?
  2. What version of psql do you have installed?
  3. Can you connect directly with psql $DATABASE_URL?
  4. If you install a previous version of the Heroku CLI (heroku update --version 8.7.0), does this functionality work?

@brettchalupa
Copy link

@k80bowman here's some answers to those questions!

  1. nope, both env | grep PG and env | grep PSQL return nothing
  2. psql --version outputs: psql (PostgreSQL) 14.10 (Homebrew)
  3. same error when running psql postgres://ABC123:DEF456@ec2-ZXY123.compute-1.amazonaws.com:5432/0987654321 (changed URL to obscure it)
    psql: error: connection to server at "ec2-ZXY123.compute-1.amazonaws.com" (SOMEIP), port 5432 failed: 
    FATAL:  no PostgreSQL user name specified in startup packet
    connection to server at "ec2-ZXY123.compute-1.amazonaws.com" (SOMEIP), port 5432 failed: FATAL:  no 
    PostgreSQL user name specified in startup packet
    psql(8711,0x7ff84d4bd700) malloc: *** error for object 0xe3: pointer being freed was not allocated
    psql(8711,0x7ff84d4bd700) malloc: *** set a breakpoint in malloc_error_break to debug
    Abort trap: 6
    
  4. nope, same issue on version 8.7.0

Let me know if I can do any other testing or debugging! I've installed postresql through Homebrew on my machine.

@k80bowman
Copy link
Contributor

@brettchalupa thank you, that is very helpful!

@k80bowman
Copy link
Contributor

@brettchalupa I've discussed this with some other folks here and, especially given that you are seeing the same error when using the psql command directly, I don't believe that this is a CLI issue. I would recommend reaching out to Heroku Support, they may have seen this issue before and could help you better.

@brettchalupa
Copy link

@k80bowman makes sense and sounds good! Thanks for the help.

I've got a Fedora Linux computer I use too and thought I'd do some more testing. Theheroku pg:psql command works. I ran all the tests you provided on Heroku CLI v8.7.1 and it's all working as expected:

  1. psql --version outputs psql (PostgreSQL) 15.4
  2. I can connect to the URL with psql directly

so maybe it's an issue with psql v14.X on macOS specifically? That'd make sense given the debugging and info.

@k80bowman
Copy link
Contributor

Thanks for the update, I hope you're able to get the problem resolved. I'm going to go ahead and close this issue for now, but please reopen in the future if needed.

@alexandregaldeano
Copy link

I had the same issue with PostgreSQL 16.0, doing brew upgrade libpq fixed it. See Homebrew/homebrew-core#155651 (comment)

@alessandrostein
Copy link

Having the same issue here 👋

macOS Monterey 12.2.1

▶ psql -V
psql (PostgreSQL) 14.9 (Homebrew)

@bryanwoods
Copy link

bryanwoods commented Jan 18, 2024

I'm also having this issue -- let me know if I can provide any other information that might be helpful.

macOS Ventura 13.4

>> psql -V
psql (PostgreSQL) 14.9 (Homebrew)
>> heroku --version
heroku/8.5.0 darwin-arm64 node-v16.19.0

@k80bowman
Copy link
Contributor

@alessandrostein and @bryanwoods, we've had some internal folks run into this problem when they used Homebrew to install postgreSQL, which it looks like you have as well. We recommend following the instructions for installing it without Homebrew, hopefully doing that will resolve the issues you are seeing.

@MatthiasRMS
Copy link

I had the same issue with PostgreSQL 16.0, doing brew upgrade libpq fixed it. See Homebrew/homebrew-core#155651 (comment)

For others facing the same issue on MacOS, I can confirm this solved my issue as well :-) Thanks @alexandregaldeano

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants