Your data directory is not writable nextcloud 23.0.5snap1

I have installed the latest version of nextcloud on my raspberrypi 4 with ubuntu core 20.
I made use of the following commands to install nextcloud.

sudo snap refresh
sudo snap install core core18
sudo snap install nextcloud
sudo mkdir /var/snap/nextcloud/common/nextcloud/data/
sudo mount /dev/sda1 /var/snap/nextcloud/common/nextcloud/data/
sudo nextcloud.manual-install username password
sudo nextcloud.occ config:system:set trusted_domains 1 --value=ip-adres
sudo ufw allow 80,443/tcp
sudo nextcloud.enable-https self-signed
sudo snap connect nextcloud:removable-media
sudo nextcloud.occ maintenance:mimetype:update-db
sudo nextcloud.occ maintenance:mimetype:update-js
sudo nextcloud.occ maintenance:theme:update
sudo snap restart nextcloud

but after a while i get the following error:

Your data directory is not writable
Permissions can usually be fixed by giving the webserver write access to the root directory. See

An unhandled exception has been thrown:
Exception: Environment not properly prepared. in /snap/nextcloud/30877/htdocs/lib/private/Console/Application.php:164
Stack trace:
#0 /snap/nextcloud/30877/htdocs/console.php(98): OC\Console\Application->loadCommands()
#1 /snap/nextcloud/30877/htdocs/occ(11): require_once('...')
#2 {main}root@ubuntu:/var/snap/nextcloud/current/nextcloud/config#

does someone know what to do. I have done the install multiple times manual as well.