Docker PSU setup & Persistent volume - question on solving for Data Protection

I’ve followed the instructions for Docker in the documentation, and followed through with the persistent volume steps.
Am I supposed to be doing something to address the encryption keys .net data-protection in docker
Issues im seeing:

  • ‘Error unprotecting the session cookie.’ in the logs
  • after the first restart, it loses all the settings/config… i suspect it’s actually unable to read the database files it created in the first startup

The encryption key problem is typically because you ran PSU on the same address\port and then ran the server again on the same address and port but in a different way.

For example, you had it running locally on port 5000 and then you started it up in docker on port 5000 and it used the same cookies. That’s when you’ll see that warning\error. Usually, I don’t see any side effects of this and PSU behaves.

As for losing the config files, that shouldn’t be happening and is unrelated to the “unprotecting cookie” problem. We recently made a change to our dockerfile and updated the docs about persistence so this could still be an issue. More info here: Issues running in Docker what am I missing - #8 by rsrychro

Is there any way you can share the dockerfile or command line you ran to configure you instance?

Command

docker run --name powershelluniversal --mount source=psudata,target=/data --rm -d -p 5000:5000/tcp universal-persistent:latest

Dockerfile

FROM ironmansoftware/universal:latest
LABEL description=“Universal - The ultimate platform for building web-based IT Tools”
EXPOSE 5000
VOLUME [“/data”]
ENV Data__RepositoryPath ./data/Repository
ENV Data__ConnectionString ./data/database.db
ENV UniversalDashboard__AssetsFolder ./data/UniversalDashboard
ENV Logging__Path ./data/logs/log.txt
ENTRYPOINT [“./Universal/Universal.Server”]

Results in a license upload showing in the ‘diff’ folder for the running container, and on restart it goes away.

\wsl$\docker-desktop-data\version-pack-data\community\docker\overlay2\3db1018cece257e944072211bfdc33e21080d43b426ee4dfa209abfbd8d2533e\diff\home\data\Repository.universal

the volume named psudata, specified in the run command remains empty

\docker\volumes\psudata_data

The below results in a scenario where the persistent volume seems to populate, but after a container restart it creates a new /data folder structure below the existing one (see screenshot)

(edit) Note: on 3rd startup and beyond, it seems to continue to use the folder structure created on the second startup. Unfortunately some parts of the app dont work properly because the folder structure is mangled, so it returns 500 on things like creating a folder in the ‘scripts’ area.
This issue is repeatable, i can delete the volume, and it behaves the same as the above test.

run command

docker run --name powershelluniversal --mount source=psudata,target=/home/data --rm -d -p 5000:5000/tcp universal-persistent:latest

Dockerfile

FROM ironmansoftware/universal:latest
LABEL description=“Universal - The ultimate platform for building web-based IT Tools”
EXPOSE 5000
VOLUME [“/home/data”]
ENV Data__RepositoryPath ./data/Repository
ENV Data__ConnectionString ./data/database.db
ENV UniversalDashboard__AssetsFolder ./data/UniversalDashboard
ENV Logging__Path ./data/logs/log.txt
ENTRYPOINT [“./Universal/Universal.Server”]

1 Like