This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

gwonzhang
gwonzhang

Tried to deploy my site to Amazon Lightsail, using official deploy plugin, and this is the error:

Update Failed
SQLSTATE[HY000] [14] unable to open database file

How can I fix it? Thanks.

Last updated

daftspunky
daftspunky

Hi @gwonzhang,

What database type are you using (MySQL, sqlite, ...)?

Thanks

gwonzhang
gwonzhang

Hi, I'm using sqlite

daftspunky
daftspunky

Check in your .env (Envirionment Variables) for the DATABASE_NAME and it should point to a file on the filesystem. Like this

DB_DATABASE=storage/database.sqlite

Make sure that the file exists. It complains that it cannot open that file either because it doesn't exist or it doesn't have the appropriate permissions (read access).

I hope this helps

gwonzhang
gwonzhang

Hi, the database file is there. I'm on MAMP local environment. This is what it says on terminal for this file, seems it has read access already.

-rw-r--r--  1 kangaroodesign  admin  380928 24 Jun 11:17 database.sqlite

A bit frustrated, cannot get the site to server... :(

Last updated

daftspunky
daftspunky

The file must be accessible to the "apache" or "www-data" user, so in this case, the permissions may need changing to 755 or equivalent

gwonzhang
gwonzhang

Hi, after permissions changed to 755, same error, plus another error:

Update Failed
A valid response from a beacon was not found. Add ?debug=1 to your URL, try again and check the logs (Code: 0)

Lightsail might be too much trouble for me, I decided to switch to a shared hosting, and upload all the folders and files, and it works now.

I will stick to shared hosting for now.

Thanks again for the help.

daftspunky
daftspunky

No problem. In case anyone else stumbles across this, the next thing to check would be the default pathing

DB_DATABASE=/include/full/path/to/storage/database.sqlite

You may need to specify the full path to the database file

1-8 of 8

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.