Constant Dev Container Issues

Hello all.

I am trying to develop an app for Nextcloud using the dev container provided here. For the past couple of days I have had nothing but issues leading to no progress.

How I start the container:

When starting the container I follow the Windows tutorial provided in the link above. This uses WSL and creates a docker container on that system running Nextcloud. The container typically starts just fine and I am able to connect to it via nextcloud.local.

How I am attempting to develop:

I am using VS Code to open the workspace on the WSL system. Here I can add my app skeleton and start trying to add onto the base app.

Issues I’m having:

This is where things start to go wrong. I have had several different issues so I will list them one by one:

  • The dev container randomly lost its CAN_INSTALL file (Seems to be fixed after freeing up space even though 50GB was already free)
  • Blank login screen with the following error found in the webpage console: Content-Security-Policy: The page’s settings blocked an inline script (script-src-elem) from being executed because it violates the following directive: “script-src 'self'”. This was a fresh install and I had only added my skeleton app to the apps-extra folder.
  • After staring the container and leaving it running for a bit, it will eventually complain about the inability to write to the config file. This doesn’t make much sense since I have not been setting up a config file. Creating one then changing the owner to www-data typically fixes this but not always. Stopping the containers, deleting them, then recreating them is another solution.

What I am expecting/hoping for:
I was hoping the tutorial published by Nextcloud would work well but this has not been the case so far. I have never worked with this type of project before and it has been frustrating. In all instances there have been no logs produced in the data folder so I have been unable to look into the why of all of this.

I am posting here in hopes that someone might be able to tell me what I am doing wrong and offer some guidance. If anyone can offer such help, please let me know.

Thank you for your time.

Hello.

Consistently? That is no further problems down the road and at some point you loose connection, right?

Just to make this clear: You try to install the dev environment from Julius locally on your Win machine (using WSL). Correct?

Well, I am more concerned that you imply it is still there if there is sufficient storage present.
In fact, this file is an indicator that the install process is not yet started and the NC installation can be seen as a pristine setup. After the setup the file is dropped as a security measure to avoid unintentional reinstallation and data loss in production. So, it should vanish.

Why do you complain about the file not being present? Do you get a message somehow? Did you follow the guide 1:1? There might be something off but this needs fixing then. (Eventually also fixing in the code/documentation, we will see)

Did this happen with the app not yet copied? You wrote you could access the NC in the first paragraph…

The error itself is probably not related. Are you by chance using Firefox? There are a few settings in the dev setup to help development that is implemented by adding JS code ar various places. One prominent example is the Vue dev tools that trigger this error (and will not work out of the box thus). You might want to have a look what triggered the warning. Also the HMR app might be of interest (only for debugging machines!!!)

The config file is written during setup/installation of the server. So, there it must be created. The owner must for sure be www-data for the NC to be able to update the config.

What are the actual rights of the file when the issue arises?
In your setup the file will probably reside in the windows part of your setup (not in the WSL file system), thus the permissions might always get a bit hairy (Windows does not support the same file permission system as linux. Thus, the WSL has some mapping installed but not everything works well out of the box).

That is dubious but could also be a permission issue (can www-data in fact create the file?).

What you could do: Enter the container interactively as the www-data user and see what permissions are there. You could try to touch files (should not cause errors) or touch the NC log file. I suspect that there you find a permission issue.

Unfortunately, I am not able to run the dev container on Win (I am running Linux natively) but at work I use WSL+docker from time to time. There I saw quite some interesting effects. Let’s now track this down :smile:.

Chris

1 Like