@gmagnusson Are you using the official farmOS image? And if so, are you using 1.x or 2.x? And is it the production image or the development image?
We have a special docker-entrypoint.sh script that helps to populate the sites directory for you the first time. This works a bit differently in 1.x vs 2.x and prod vs dev images. Happy to point you to the relevant code to help you understand.
If you are overriding the image (or especially the entrypoint script), then it might be breaking this logic.
# If the sites directory is empty, populate it from pre-built files.
if [ -d /opt/drupal/web/sites ] && ! [ "$(ls -A /opt/drupal/web/sites/)" ]; then
echo "farmOS sites directory not detected. Copying from pre-built files in the Docker image."
cp -rp /var/farmOS/web/sites/. /opt/drupal/web/sites
fi
This is just helper logic to fix the exact issue you’re describing. Alternatively, if you don’t want to use this logic, you can simply install farmOS using a standard Drupal process, which would be to manually copy default.settings.php to settings.php and make it writable by www-data.
Ah OK then it may be a permissions issue… During installation, Drupal will attempt to copy default.settings.php to settings.php itself and then write database details etc to it. But if that directory is not writeable by www-data then it won’t be able to. This would not only affect initial installation, but also uploading files later when you’re using farmOS.
Can you check whether or not that directory is writable by www-data?
Oh wait I’m also noticing some inconsistencies in your docker-compose.yml (unrelated to this issue perhaps, but worth asking about)… it looks like you’ve got a mix of farmOS 1.x vs 2.x and development vs production templates…
PostgreSQL is the recommended database for farmOS 2.x (MariaDB will also work, but I assume you go that from the 1.x docker-compose.development.yml template).
Also, I see XDEBUG_CONFIG environment variable being used. This will only have an affect if you are running the 1.x-dev or 2.x-dev images, so it’s harmless… but it also looks like you copied that from the 1.x template. Those variables are different in 2.x.
I’m wondering if maybe both of you are running on Windows? I’m not very familiar with how Linux permissions (which is what is expected within the Docker container) are treated by a Windows host system.
I encountered this issue when i used the production.yml file and when i used the development.yml i encounter the other issue i have opened up after the modules started to get installed.
@mstenta I did get past this issue but the solution is unconfirmed.
I reverted back to the recommended docker-compose.development.yml for 2.x. I still saw this error on multiple attempts to install and fiddle with permissions. Eventually I got past it simply by refreshing the page. Seems like settings.php was not copied until I rendered the install page a second time.
i am trying to connect to a postgres DB i made on my local machine i am trying to connect to that but its giving me that error, if you faced it how did you overcame it? Do i have to enable the local host and port in firewall, or through some settings in postgresql?
I saw something similar. I was launching both FarmOS and Postgres from docker-compose. Initially I set the DB host as localhost and got this error. When I set the host to db which is the service name in docker-compose it worked fine.
If you’re running Postgres outside of docker, maybe there is some trick required to make sure the docker network has access to it. I don’t know exactly what steps you might need.