Can't access database on my new Disk

I just deployed a rails app, and I’m wanting to use an sqlite3 database. I have added the database to a disk, and now I’m just trying to figure out how to access it.

I tried specifying the location of the database file:

/var/data/db/production.sqlite3

But upon deploy, I get this error:

Errno::ENOENT: No such file or directory @ dir_s_mkdir - /var/data/db

That directory definitely exists.

So I tried adding a symlink command to the build command:
ln -s /var/data/db/production.sqlite3 db/production.sqlite3

Now it can find the file, but gives me the error that the file cannot be opened. Permissions all seem correct.

How do I access the sqlite3 database on my disk from my Rails app?

I tried to create a new database as part of the build command. This is what I received:

Jun 18 06:08:51 AM  Database not found
Jun 18 06:08:51 AM  Couldn't create '/var/data/db/production.sqlite3' database. Please check your configuration.
Jun 18 06:08:53 AM  Caused by:
Jun 18 06:08:53 AM  Errno::ENOENT: No such file or directory @ dir_s_mkdir - /var/data/db

Could it be that the drive has not yet been mounted at that point in the deploy?

I tried /var/data' instead of /var/data/db`. This is what it said:

Jun 18 09:31:25 AM Errno::EROFS: Read-only file system @ dir_s_mkdir - /var/data

Why would my mount be read only? I can write to it from SSH, so I don’t understand why the deploy can’t write to it. Permissions are 775.

We’ve followed up with the support ticket opened also about this.

Disks are attached to a service at deploy time - they are not available at build time.

Regards,