#Laravel Cloud Failed Deployment (database)

11 messages · Page 1 of 1 (latest)

bronze folio
#

Hello,

I am currently migrating from Vapor to Cloud. I added the github repo to Cloud, deleted the manifest.yaml and vapor.yml files, and added a private mysql database in Cloud. The database name is "<database_name>" (for the purposes of this post).

I am currently getting the following when deploying the application:

  • Preparing build environment succeeds
  • Running build commands succeeds
  • Pushing application succeeds
  • Preparing deploy environment succeeds
  • Running deploy commands fails: In Connection.php: Unknown database '<database_name>'

Has anyone seen this before? Have any ideas on how to resolve the issue? Any ideas are greatly appreciated!

alpine stump
#

Check the DB_CONNECTION in the .env file, or maybe in your Connection.php file. Verify it's mysql(or the driver you are using).

tawdry island
#

What do you env settings in Cloud look like? Laravel Cloud injects those credentials if the DB is attached to the app/environment

#

So you might be overwriting them, thus causing it to not be able to connect

bronze folio
bronze folio
bronze folio
#

But like... these are the reasons I am so confused. All env vars were auto-injected by Cloud, yet, it is giving me a seemingly-related error.

alpine stump
#

Have your tried refreshing cache?
php artisan config:clear
php artisan config:cache

bronze folio
#

When I try to run the commands via the Commands tab, it says I am unable to since I have no active deployment.

tawdry island
#

Yeah, think those commands wouldn't really have an effect in Cloud anyways