SQLSTATE […] Access denied:

Continuing the discussion from SQLSTATE […] Access denied:

My monica instance was migrated from Heroku 1 when they stopped their free instances.

I have never set any DB credentials here on fly.io, and the app has been running without a hitch since September 2022…

Added databases

Hi… What do you see in fly secrets list and fly apps list?

Generally, the credentials he was referring to would have been inducted into the secrets vault, to prevent accidental leakage.

❯ fly secrets list
NAME                            	DIGEST                          	CREATED AT        
APP_DEBUG                       	SomeNumbersAndLetter	Aug 26 2022 08:34	
APP_DISABLE_SIGNUP              	SomeNumbersAndLetter	Aug 26 2022 08:34	
APP_EMAIL_NEW_USERS_NOTIFICATION	SomeNumbersAndLetter	Aug 26 2022 08:34	
APP_ENV                         	SomeNumbersAndLetter	Aug 26 2022 08:34	
APP_KEY                         	SomeNumbersAndLetter	Aug 26 2022 08:34	
APP_URL                         	SomeNumbersAndLetter	Aug 26 2022 08:34	
DB_CONNECTION                   	SomeNumbersAndLetter	Aug 26 2022 08:34	
HEROKU                          	SomeNumbersAndLetter	Aug 26 2022 08:34	
JAWSDB_URL                      	SomeNumbersAndLetter	Aug 26 2022 08:34	
MAIL_FROM_ADDRESS               	SomeNumbersAndLetter	Aug 26 2022 08:34	
MAIL_FROM_NAME                  	SomeNumbersAndLetter	Aug 26 2022 08:34	
SENTRY_DSN                      	SomeNumbersAndLetter    Feb 28 2024 11:28	


❯ fly apps list
NAME       	    OWNER   	STATUS  	LATEST DEPLOY     
given-app-name	personal	deployed	Feb 28 2024 11:28

Ok… Try the following, but just post the overall structure again—and not specific usernames and passwords:

fly m start  # ensure that at least one machine is running
fly ssh console -C env

I’m guessing that it’s either DB_CONNECTION or JAWSDB_URL that we’re looking for, but multiple things are fairly unclear at this point…

1 Like
❯ fly ssh console -C env
WARN The running flyctl agent (v0.2.11) is older than the current flyctl (v0.2.13).
WARN The out-of-date agent will be shut down along with existing wireguard connections. The new agent will start automatically as needed.
Connecting to SomeNumbersAndLetter... complete
APP_DEBUG=false
APP_DISABLE_SIGNUP=false
APP_EMAIL_NEW_USERS_NOTIFICATION=myemail@domain.com
APP_ENV=production
APP_KEY=SomeNumbersAndLetter
APP_URL=https://monica-habi.herokuapp.com
DB_CONNECTION=heroku
FLY_ALLOC_ID=SomeNumbersAndLetter
FLY_APP_NAME=TheCorrectName
FLY_IMAGE_REF=registry.fly.io/monica-habi:deployment-SomeNumbersAndLetter
FLY_MACHINE_ID=SomeNumbersAndLetter
FLY_MACHINE_VERSION=SomeNumbersAndLetter
FLY_PRIVATE_IP=SomeNumbersAndLetter
FLY_PROCESS_GROUP=app
FLY_PUBLIC_IP=SomeNumbersAndLetter
FLY_REGION=fra
FLY_VM_MEMORY_MB=512
HEROKU=true
JAWSDB_URL=mysql://SomeNumbersAndLetter:SomeNumbersAndLetter@SomeNumbersAndLetter.SomeNumbersAndLetter.eu-west-1.rds.amazonaws.com:3306/SomeNumbersAndLetter
MAIL_FROM_ADDRESS=myemail@domain.com
MAIL_FROM_NAME=Monica
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PORT=8080
PRIMARY_REGION=fra
SENTRY_DSN=https://SomeNumbersAndLetter@SomeNumbersAndLetter.ingest.sentry.io/SomeNumbersAndLetter
SSH_DNS_SERVER=[fdaa::3]:53
SSH_LISTEN=[SomeNumbersAndLetter]:22
cgroup_enable=memory
SHELL=/bin/bash
HOME=/root
FLY_SSH=1
TERM=

Thanks, this is progress… Your database is MySQL hosted on AWS, rather than Fly.

The credentials @lubien was referring to are the first two SomeNumbersAndLetters strings after the mysql://.

Your egress IP may have changed since all this was first installed, causing the DB server to reject new login attempts.

Do you have a MySQL client installed locally? If so, try connecting from there, using the above. (The URL format is mysql://user:password@host:port/schema.)

I’m trying with Sequel Pro, but don’t manage to connect, unfortunately.

The credentials are
JAWSDB_URL=mysql://z1n6upzt9x925e4u:XXXXXXXX@XXXXXXXXng1bygi8.chr7pe7iynqr.eu-west-1.rds.amazonaws.com:3306/XXXXXXXX, which looks like this in the app.

The error message I get makes me think that the database does not exist (anymore)…

It might help to turn SSL on, in the lower checkbox; that might be mandatory now.

Also, can you ping the host itself?

ping -c 3 XXXXXXXXng1bygi8.chr7pe7iynqr.eu-west-1.rds.amazonaws.com

When I ping the host, another one does not answer.

PING ec2-54-195-XXX-XXX.eu-west-1.compute.amazonaws.com (54.195.234.236): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2

I guess that confirms that the database was not migrated from Heroku and my personal CRM I’ve been using for years is now dead and all data lost :frowning:

Not necessarily… Some networks block ping, for example.

I was able to get an initial TCP connection through to the IPv4 address that you listed using socat, which is a low-level packet sender:

$ socat TCP4:54.195.234.236:3306 STDIO
J
<binary-waffle>([omysql_native_password
foo
<more-binary-waffle>#08S01Got packets out of order

It’s not pretty, but it does look like a MySQL server responding.

If you still have your old Heroku account login, it might be worth checking to see if there’s a message about DB service being suspended or passwords having been expired.

I can still log in with Heroku, but everything is empty there.
There is an option to create Datastores or Dataclips, but I see nothing MySQL like.

Hm… I’m not very familiar with their service, overall…

It appears that the database was originally created via the add-on JawsDB, so that might be another thing to look for.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.