ufal / clarin-dspace

clarin-dspace digital repository based on DSpace and LINDAT/CLARIN DSpace
http://lindat.cz
BSD 3-Clause "New" or "Revised" License
27 stars 18 forks source link

Error: EISDIR: illegal operation on a directory, read #1091

Closed kosarko closed 11 months ago

kosarko commented 11 months ago
$ docker compose --env-file .env -f docker/docker-compose.yml -f docker/docker-compose-rest.yml logs dspace-angular | grep -A 16 config.prod.yml

--
dspace-angular1  | 3|dspace-ui  | Overriding app config with /app/config/config.prod.yml
dspace-angular1  | 3|dspace-ui  | Error: EISDIR: illegal operation on a directory, read
dspace-angular1  | 3|dspace-ui  |     at Object.readSync (node:fs:751:3)
dspace-angular1  | 3|dspace-ui  |     at tryReadSync (node:fs:451:20)
dspace-angular1  | 3|dspace-ui  |     at readFileSync (node:fs:497:19)
dspace-angular1  | 3|dspace-ui  |     at overrideWithConfig (/app/dist/server/main.js:1:8050197)
dspace-angular1  | 3|dspace-ui  |     at buildAppConfig (/app/dist/server/main.js:1:8052066)
dspace-angular1  | 3|dspace-ui  |     at /app/dist/server/main.js:1:8054422
dspace-angular1  | 3|dspace-ui  |     at /app/dist/server/main.js:1:8062524
dspace-angular1  | 3|dspace-ui  |     at Object.<anonymous> (/app/dist/server/main.js:1:8062756)
dspace-angular1  | 3|dspace-ui  |     at Module._compile (node:internal/modules/cjs/loader:1256:14)
dspace-angular1  | 3|dspace-ui  |     at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) {
dspace-angular1  | 3|dspace-ui  |   errno: -21,
dspace-angular1  | 3|dspace-ui  |   syscall: 'read',
dspace-angular1  | 3|dspace-ui  |   code: 'EISDIR'
dspace-angular1  | 3|dspace-ui  | }
dspace-angular1  | 3|dspace-ui  | Applying environment variable DSPACE_UI_SSL with value false

I guess (as config.prod.yml does not exist in git) the root cause might be:

...non-existent bind mounts from the docker engine will get initialized to an empty directory owned by root.

https://stackoverflow.com/questions/44574078/mount-non-existing-host-directory-into-non-root-container

Maybe I've missed a step in the initial setup and should have created an empty file? @milanmajchrak

MajoBerger commented 11 months ago

You are indeed right @kosarko. It is mentioned at the end of this section in readme, but only very briefly. We just added placeholder config file to git, so I recommend pulling newest version and the error should be resolved. When in need of configuring something, it should be hereafter possible to just edit that file (local.cfg for BE and config.prod.yml for FE) and restart container to apply new config.