H
Homarr12mo ago
Phoenixx

Errors when starting the docker container

Im not entirely sure what I am doing wrong when starting the container but I keep getting this error when I attempt to start the container
homarr | Exporting hostname...
homarr | Migrating database...
homarr | yarn run v1.22.19
homarr | $ ts-node ./migrate.ts
homarr | /app/migrate/node_modules/better-sqlite3/lib/database.js:69
homarr | [util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
homarr | ^
homarr | SqliteError: unable to open database file
homarr | at new Database (/app/migrate/node_modules/better-sqlite3/lib/database.js:69:26)
homarr | at Object.<anonymous> (/app/migrate/migrate.ts:12:16)
homarr | at Module._compile (node:internal/modules/cjs/loader:1255:14)
homarr | at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
homarr | at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
homarr | at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
homarr | at Module.load (node:internal/modules/cjs/loader:1113:32)
homarr | at Function.Module._load (node:internal/modules/cjs/loader:960:12)
homarr | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
homarr | at phase4 (/app/migrate/node_modules/ts-node/src/bin.ts:649:14) {
homarr | code: 'SQLITE_CANTOPEN'
homarr | }
homarr | error Command failed with exit code 1.
homarr | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
homarr | cp: cannot create regular file '/app/data/configs/default.json': Permission denied
homarr | Starting production server...
homarr | Error: EACCES: permission denied, opendir '/app/public/icons'
homarr | at Object.opendirSync (node:internal/fs/dir:335:3)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:20:32)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:25:13)
homarr | at NextNodeServer.generatePublicRoutes (/app/node_modules/next/dist/server/next-server.js:504:84)
homarr | at NextNodeServer.generateRoutes (/app/node_modules/next/dist/server/next-server.js:816:35)
homarr | at new Server (/app/node_modules/next/dist/server/base-server.js:206:48)
homarr | at new NextNodeServer (/app/node_modules/next/dist/server/next-server.js:175:9)
homarr | at NextServer.createServer (/app/node_modules/next/dist/server/next.js:179:24)
homarr | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
homarr | at async /app/node_modules/next/dist/server/next.js:200:31 {
homarr | type: 'Error',
homarr | errno: -13,
homarr | syscall: 'opendir',
homarr | code: 'EACCES',
homarr | path: '/app/public/icons'
homarr | }
homarr | Exporting hostname...
homarr | Migrating database...
homarr | yarn run v1.22.19
homarr | $ ts-node ./migrate.ts
homarr | /app/migrate/node_modules/better-sqlite3/lib/database.js:69
homarr | [util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
homarr | ^
homarr | SqliteError: unable to open database file
homarr | at new Database (/app/migrate/node_modules/better-sqlite3/lib/database.js:69:26)
homarr | at Object.<anonymous> (/app/migrate/migrate.ts:12:16)
homarr | at Module._compile (node:internal/modules/cjs/loader:1255:14)
homarr | at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
homarr | at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
homarr | at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
homarr | at Module.load (node:internal/modules/cjs/loader:1113:32)
homarr | at Function.Module._load (node:internal/modules/cjs/loader:960:12)
homarr | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
homarr | at phase4 (/app/migrate/node_modules/ts-node/src/bin.ts:649:14) {
homarr | code: 'SQLITE_CANTOPEN'
homarr | }
homarr | error Command failed with exit code 1.
homarr | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
homarr | cp: cannot create regular file '/app/data/configs/default.json': Permission denied
homarr | Starting production server...
homarr | Error: EACCES: permission denied, opendir '/app/public/icons'
homarr | at Object.opendirSync (node:internal/fs/dir:335:3)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:20:32)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:25:13)
homarr | at NextNodeServer.generatePublicRoutes (/app/node_modules/next/dist/server/next-server.js:504:84)
homarr | at NextNodeServer.generateRoutes (/app/node_modules/next/dist/server/next-server.js:816:35)
homarr | at new Server (/app/node_modules/next/dist/server/base-server.js:206:48)
homarr | at new NextNodeServer (/app/node_modules/next/dist/server/next-server.js:175:9)
homarr | at NextServer.createServer (/app/node_modules/next/dist/server/next.js:179:24)
homarr | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
homarr | at async /app/node_modules/next/dist/server/next.js:200:31 {
homarr | type: 'Error',
homarr | errno: -13,
homarr | syscall: 'opendir',
homarr | code: 'EACCES',
homarr | path: '/app/public/icons'
homarr | }
37 Replies
Manicraft1001
Manicraft100112mo ago
Hi @Phoenixx , the mounted icons directory is either read-only or the docker user does not have the correct permissions.
Phoenixx
PhoenixxOP12mo ago
These are the permissions for the directory, what should they be set to?
Manicraft1001
Manicraft100112mo ago
Which user is running docker? What is your compose?
Phoenixx
PhoenixxOP12mo ago
The user is phoenixx and you want what is in my docker-compose file?
version: '3'
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- /home/phoenixx/Desktop/homarr/configs:/app/data/configs
- /home/phoenixx/Desktop/homarr/icons:/app/public/icons
- /home/phoenixx/Destkop/homarr/data:/data
ports:
- '7575:7575'
version: '3'
#---------------------------------------------------------------------#
# Homarr - A simple, yet powerful dashboard for your server. #
#---------------------------------------------------------------------#
services:
homarr:
container_name: homarr
image: ghcr.io/ajnart/homarr:latest
restart: unless-stopped
volumes:
- /var/run/docker.sock:/var/run/docker.sock # Optional, only if you want docker integration
- /home/phoenixx/Desktop/homarr/configs:/app/data/configs
- /home/phoenixx/Desktop/homarr/icons:/app/public/icons
- /home/phoenixx/Destkop/homarr/data:/data
ports:
- '7575:7575'
That is the contents of my docker-compose file My issues are probably going to be with the permissions or this docker file since I have both a minecraft server and mealie running on docker on this same computer
Manicraft1001
Manicraft100112mo ago
Other containers shouldn't interfere, as long as you don't mess up ports or network config. Looking at the compose file and you ls list, I'd say that docker isn't running as pheonixx Are you sure that it is?
Phoenixx
PhoenixxOP12mo ago
It should have been running as phoenixx, how would I check this I am semi new to docker, I have done some in the past including in my college's devops class but that itself was very minimal
Manicraft1001
Manicraft100112mo ago
Medium
Understanding how uid and gid work in Docker containers
Understanding how usernames, group names, user ids (uid) and group ids (gid) map between the processes running inside a container and the…
Manicraft1001
Manicraft100112mo ago
Please note that Homarr currenlty has a bug with UID and GID, where it might not work / start / migrate the db when they are specified.
Phoenixx
PhoenixxOP12mo ago
I specified uid and gid in the docker compose file and it is still giving the same error, does that mean it the issue is now the bug or is there something else at play?
Manicraft1001
Manicraft100112mo ago
Providing a user can trigger the bug. But if it's still the same error, I'd say that something else is interfeering
Phoenixx
PhoenixxOP12mo ago
The new error is longer this time
Manicraft1001
Manicraft100112mo ago
Still the same reason though You could test, whether it's a permission issue, by setting 777 on the file. Just don't run it permanently this way, as the use of 777 is discouraged due to security.
Phoenixx
PhoenixxOP12mo ago
Setting 777 on the docker-compose or app?
Manicraft1001
Manicraft100112mo ago
All the mounted directories - not the compose file
Phoenixx
PhoenixxOP12mo ago
Alright This is what perms look like now Nope did not change Other than going back to the previous error
homarr | Exporting hostname...
homarr | Migrating database...
homarr | yarn run v1.22.19
homarr | $ ts-node ./migrate.ts
homarr | /app/migrate/node_modules/better-sqlite3/lib/database.js:69
homarr | [util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
homarr | ^
homarr | SqliteError: unable to open database file
homarr | at new Database (/app/migrate/node_modules/better-sqlite3/lib/database.js:69:26)
homarr | at Object.<anonymous> (/app/migrate/migrate.ts:12:16)
homarr | at Module._compile (node:internal/modules/cjs/loader:1255:14)
homarr | at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
homarr | at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
homarr | at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
homarr | at Module.load (node:internal/modules/cjs/loader:1113:32)
homarr | at Function.Module._load (node:internal/modules/cjs/loader:960:12)
homarr | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
homarr | at phase4 (/app/migrate/node_modules/ts-node/src/bin.ts:649:14) {
homarr | code: 'SQLITE_CANTOPEN'
homarr | }
homarr | error Command failed with exit code 1.
homarr | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
homarr | cp: cannot create regular file '/app/data/configs/default.json': Permission denied
homarr | Starting production server...
homarr | Error: EACCES: permission denied, opendir '/app/public/icons'
homarr | at Object.opendirSync (node:internal/fs/dir:335:3)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:20:32)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:25:13)
homarr | at NextNodeServer.generatePublicRoutes (/app/node_modules/next/dist/server/next-server.js:504:84)
homarr | at NextNodeServer.generateRoutes (/app/node_modules/next/dist/server/next-server.js:816:35)
homarr | at new Server (/app/node_modules/next/dist/server/base-server.js:206:48)
homarr | at new NextNodeServer (/app/node_modules/next/dist/server/next-server.js:175:9)
homarr | at NextServer.createServer (/app/node_modules/next/dist/server/next.js:179:24)
homarr | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
homarr | at async /app/node_modules/next/dist/server/next.js:200:31 {
homarr | type: 'Error',
homarr | errno: -13,
homarr | syscall: 'opendir',
homarr | code: 'EACCES',
homarr | path: '/app/public/icons'
homarr | }
homarr | Exporting hostname...
homarr | Migrating database...
homarr | yarn run v1.22.19
homarr | $ ts-node ./migrate.ts
homarr | /app/migrate/node_modules/better-sqlite3/lib/database.js:69
homarr | [util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
homarr | ^
homarr | SqliteError: unable to open database file
homarr | at new Database (/app/migrate/node_modules/better-sqlite3/lib/database.js:69:26)
homarr | at Object.<anonymous> (/app/migrate/migrate.ts:12:16)
homarr | at Module._compile (node:internal/modules/cjs/loader:1255:14)
homarr | at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
homarr | at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
homarr | at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
homarr | at Module.load (node:internal/modules/cjs/loader:1113:32)
homarr | at Function.Module._load (node:internal/modules/cjs/loader:960:12)
homarr | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
homarr | at phase4 (/app/migrate/node_modules/ts-node/src/bin.ts:649:14) {
homarr | code: 'SQLITE_CANTOPEN'
homarr | }
homarr | error Command failed with exit code 1.
homarr | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
homarr | cp: cannot create regular file '/app/data/configs/default.json': Permission denied
homarr | Starting production server...
homarr | Error: EACCES: permission denied, opendir '/app/public/icons'
homarr | at Object.opendirSync (node:internal/fs/dir:335:3)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:20:32)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:25:13)
homarr | at NextNodeServer.generatePublicRoutes (/app/node_modules/next/dist/server/next-server.js:504:84)
homarr | at NextNodeServer.generateRoutes (/app/node_modules/next/dist/server/next-server.js:816:35)
homarr | at new Server (/app/node_modules/next/dist/server/base-server.js:206:48)
homarr | at new NextNodeServer (/app/node_modules/next/dist/server/next-server.js:175:9)
homarr | at NextServer.createServer (/app/node_modules/next/dist/server/next.js:179:24)
homarr | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
homarr | at async /app/node_modules/next/dist/server/next.js:200:31 {
homarr | type: 'Error',
homarr | errno: -13,
homarr | syscall: 'opendir',
homarr | code: 'EACCES',
homarr | path: '/app/public/icons'
homarr | }
Manicraft1001
Manicraft100112mo ago
Is /home/phoenixx/Desktop/homarr/icons read only? If not, can you completely delete the container, directories and repull the image? (don't forget to back up files if you created any boards in Homarr).
Phoenixx
PhoenixxOP12mo ago
It seems like I can do stuff since I can use touch and create a file then edit the file with no issues and without sudo Should I add --user uid:gid \ to the command?
docker run \
--name homarr \
--restart unless-stopped \
-p 7575:7575 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v <your-path>/homarr/configs:/app/data/configs \
-v <your-path>/homarr/data:/data \
-v <your-path>/homarr/icons:/app/public/icons \
-d ghcr.io/ajnart/homarr:latest
docker run \
--name homarr \
--restart unless-stopped \
-p 7575:7575 \
-v /var/run/docker.sock:/var/run/docker.sock \
-v <your-path>/homarr/configs:/app/data/configs \
-v <your-path>/homarr/data:/data \
-v <your-path>/homarr/icons:/app/public/icons \
-d ghcr.io/ajnart/homarr:latest
This command
Manicraft1001
Manicraft100112mo ago
No
Phoenixx
PhoenixxOP12mo ago
alright Default permissions for the directories
Manicraft1001
Manicraft100112mo ago
Let them be owned by root for now 👍
Phoenixx
PhoenixxOP12mo ago
homarr | Exporting hostname...
homarr | Migrating database...
homarr | yarn run v1.22.19
homarr | $ ts-node ./migrate.ts
homarr | /app/migrate/node_modules/better-sqlite3/lib/database.js:69
homarr | [util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
homarr | ^
homarr | SqliteError: unable to open database file
homarr | at new Database (/app/migrate/node_modules/better-sqlite3/lib/database.js:69:26)
homarr | at Object.<anonymous> (/app/migrate/migrate.ts:12:16)
homarr | at Module._compile (node:internal/modules/cjs/loader:1255:14)
homarr | at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
homarr | at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
homarr | at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
homarr | at Module.load (node:internal/modules/cjs/loader:1113:32)
homarr | at Function.Module._load (node:internal/modules/cjs/loader:960:12)
homarr | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
homarr | at phase4 (/app/migrate/node_modules/ts-node/src/bin.ts:649:14) {
homarr | code: 'SQLITE_CANTOPEN'
homarr | }
homarr | error Command failed with exit code 1.
homarr | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
homarr | cp: cannot create regular file '/app/data/configs/default.json': Permission denied
homarr | Starting production server...
homarr | Error: EACCES: permission denied, opendir '/app/public/icons'
homarr | at Object.opendirSync (node:internal/fs/dir:335:3)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:20:32)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:25:13)
homarr | at NextNodeServer.generatePublicRoutes (/app/node_modules/next/dist/server/next-server.js:504:84)
homarr | at NextNodeServer.generateRoutes (/app/node_modules/next/dist/server/next-server.js:816:35)
homarr | at new Server (/app/node_modules/next/dist/server/base-server.js:206:48)
homarr | at new NextNodeServer (/app/node_modules/next/dist/server/next-server.js:175:9)
homarr | at NextServer.createServer (/app/node_modules/next/dist/server/next.js:179:24)
homarr | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
homarr | at async /app/node_modules/next/dist/server/next.js:200:31 {
homarr | type: 'Error',
homarr | errno: -13,
homarr | syscall: 'opendir',
homarr | code: 'EACCES',
homarr | path: '/app/public/icons'
homarr | }
homarr | Exporting hostname...
homarr | Migrating database...
homarr | yarn run v1.22.19
homarr | $ ts-node ./migrate.ts
homarr | /app/migrate/node_modules/better-sqlite3/lib/database.js:69
homarr | [util.cppdb]: { value: new addon.Database(filename, filenameGiven, anonymous, readonly, fileMustExist, timeout, verbose || null, buffer || null) },
homarr | ^
homarr | SqliteError: unable to open database file
homarr | at new Database (/app/migrate/node_modules/better-sqlite3/lib/database.js:69:26)
homarr | at Object.<anonymous> (/app/migrate/migrate.ts:12:16)
homarr | at Module._compile (node:internal/modules/cjs/loader:1255:14)
homarr | at Module.m._compile (/app/migrate/node_modules/ts-node/src/index.ts:1618:23)
homarr | at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
homarr | at Object.require.extensions.<computed> [as .ts] (/app/migrate/node_modules/ts-node/src/index.ts:1621:12)
homarr | at Module.load (node:internal/modules/cjs/loader:1113:32)
homarr | at Function.Module._load (node:internal/modules/cjs/loader:960:12)
homarr | at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
homarr | at phase4 (/app/migrate/node_modules/ts-node/src/bin.ts:649:14) {
homarr | code: 'SQLITE_CANTOPEN'
homarr | }
homarr | error Command failed with exit code 1.
homarr | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
homarr | cp: cannot create regular file '/app/data/configs/default.json': Permission denied
homarr | Starting production server...
homarr | Error: EACCES: permission denied, opendir '/app/public/icons'
homarr | at Object.opendirSync (node:internal/fs/dir:335:3)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:20:32)
homarr | at recursiveReadDirSync (/app/node_modules/next/dist/server/lib/recursive-readdir-sync.js:25:13)
homarr | at NextNodeServer.generatePublicRoutes (/app/node_modules/next/dist/server/next-server.js:504:84)
homarr | at NextNodeServer.generateRoutes (/app/node_modules/next/dist/server/next-server.js:816:35)
homarr | at new Server (/app/node_modules/next/dist/server/base-server.js:206:48)
homarr | at new NextNodeServer (/app/node_modules/next/dist/server/next-server.js:175:9)
homarr | at NextServer.createServer (/app/node_modules/next/dist/server/next.js:179:24)
homarr | at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
homarr | at async /app/node_modules/next/dist/server/next.js:200:31 {
homarr | type: 'Error',
homarr | errno: -13,
homarr | syscall: 'opendir',
homarr | code: 'EACCES',
homarr | path: '/app/public/icons'
homarr | }
Back to this error
Manicraft1001
Manicraft100112mo ago
What are the directory permissions now?
Phoenixx
PhoenixxOP12mo ago
Manicraft1001
Manicraft100112mo ago
Can you remove the container again and start using --user 0:0 or --user root:root?
Phoenixx
PhoenixxOP12mo ago
Yeah Thats with --user 0:0
Manicraft1001
Manicraft100112mo ago
No logs at all? Even after a few seconds?
Phoenixx
PhoenixxOP12mo ago
Yeah
Manicraft1001
Manicraft100112mo ago
Then I don't know what we could try next. @ajnart @Meierschlumpf do you have an idea?
Phoenixx
PhoenixxOP12mo ago
Im going to try root:root, maybe itll make a difference maybe not Still the same issue
Meierschlumpf
Meierschlumpf12mo ago
Not sure, but you seem to have two different directories that could be mounted. Can you check, that you changed the permissions to your phoenixx user for both? I'm not sure other than that what could be the issue
Phoenixx
PhoenixxOP12mo ago
I fixed that issue, there is now one directory Any other ideas in which I could try?
Serenaphic
Serenaphic12mo ago
!NOT RECOMMENDED! Chmod 777 all of them If it still doesn't work then, it means it's not a permission issue, that's for certain
Phoenixx
PhoenixxOP12mo ago
Will try chmod 777 when I get home Yeah still having the same issue
Thomas
Thomas12mo ago
@Phoenixx try removing the mount point for configs or use a volume instead
Phoenixx
PhoenixxOP12mo ago
I figured out the issue, it had to do with SELinux
Manicraft1001
Manicraft100112mo ago
Can you post the solution here, so other users can use it as well?
Thomas
Thomas12mo ago
@Phoenixx
Want results from more Discord servers?
Add your server