DumbPad icon indicating copy to clipboard operation
DumbPad copied to clipboard

Container restarts wich E/A Error

Open MacVille opened this issue 1 year ago • 5 comments

Describe the bug I deployed DumbPad on my Docker host and i get the following Error:

dumbpad  | > [email protected] start
dumbpad  | > node server.js
dumbpad  | 
dumbpad  | ALLOWED ORIGINS: *
dumbpad  | Asset manifest generated! [
dumbpad  |   '/Assets/asset-manifest.json',
dumbpad  |   '/Assets/dumbpad.png',
dumbpad  |   '/Assets/dumbpad.svg',
dumbpad  |   '/Assets/manifest.json',
dumbpad  |   '/Assets/preview-styles.css',
dumbpad  |   '/Assets/styles.css',
dumbpad  |   '/app.js',
dumbpad  |   '/index.html',
dumbpad  |   '/login.html',
dumbpad  |   '/managers/collaboration.js',
dumbpad  |   '/managers/confirmation.js',
dumbpad  |   '/managers/cursor-manager.js',
dumbpad  |   '/managers/operations.js',
dumbpad  |   '/managers/preview.js',
dumbpad  |   '/managers/search.js',
dumbpad  |   '/managers/settings.js',
dumbpad  |   '/managers/storage.js',
dumbpad  |   '/managers/toaster.js',
dumbpad  |   '/service-worker.js'
dumbpad  | ]
dumbpad  | PWA manifest generated! {
dumbpad  |   name: 'DumbPad',
dumbpad  |   short_name: 'DumbPad',
dumbpad  |   description: 'A simple notepad application',
dumbpad  |   start_url: '/',
dumbpad  |   display: 'standalone',
dumbpad  |   background_color: '#ffffff',
dumbpad  |   theme_color: '#000000',
dumbpad  |   icons: [
dumbpad  |     { src: 'dumbpad.png', type: 'image/png', sizes: '192x192' },
dumbpad  |     { src: 'dumbpad.png', type: 'image/png', sizes: '512x512' }
dumbpad  |   ],
dumbpad  |   orientation: 'any'
dumbpad  | }
dumbpad  | Checking for notepad files to migrate...
dumbpad  | Server is running on port 3000
dumbpad  | Base URL: http://localhost:3301
dumbpad  | Environment: production
dumbpad  | Version: 1.0.4
dumbpad  | Creating new notepads.json
dumbpad  | Error initializing data directory: Error: EACCES: permission denied, open '/app/data/notepads.json'
dumbpad  |     at async open (node:internal/fs/promises:641:25)
dumbpad  |     at async Object.writeFile (node:internal/fs/promises:1215:14)
dumbpad  |     at async ensureDataDir (/app/server.js:562:13)
dumbpad  |     at async getNotepadsFromDir (/app/server.js:581:5)
dumbpad  |     at async loadNotepadsList (/app/server.js:576:26)
dumbpad  |     at async /app/server.js:739:22 {
dumbpad  |   errno: -13,
dumbpad  |   code: 'EACCES',
dumbpad  |   syscall: 'open',
dumbpad  |   path: '/app/data/notepads.json'
dumbpad  | }
dumbpad  | node:internal/process/promises:394
dumbpad  |     triggerUncaughtException(err, true /* fromPromise */);
dumbpad  |     ^
dumbpad  | 
dumbpad  | Error: EACCES: permission denied, open '/app/data/notepads.json'
dumbpad  |     at async open (node:internal/fs/promises:641:25)
dumbpad  |     at async Object.writeFile (node:internal/fs/promises:1215:14)
dumbpad  |     at async ensureDataDir (/app/server.js:562:13)
dumbpad  |     at async getNotepadsFromDir (/app/server.js:581:5)
dumbpad  |     at async loadNotepadsList (/app/server.js:576:26)
dumbpad  |     at async /app/server.js:739:22 {
dumbpad  |   errno: -13,
dumbpad  |   code: 'EACCES',
dumbpad  |   syscall: 'open',
dumbpad  |   path: '/app/data/notepads.json'
dumbpad  | }
dumbpad  | 
dumbpad  | Node.js v22.19.0
dumbpad exited with code 1

Compose File

services:
  dumbpad:
    image: dumbwareio/dumbpad:latest
    container_name: dumbpad
    restart: unless-stopped
    ports:
      - 3301:3000
    volumes:
      # Where your notes will be stored
      - ./data:/app/data
    environment:
      # The title shown in the web interface
      SITE_TITLE: DumbPad
      # Optional PIN protection (leave empty to disable)
      #DUMBPAD_PIN: 1234
      # The base URL for the application
      BASE_URL: http://localhost:3301
networks: {}

To Reproduce Steps to reproduce the behavior:

  1. Deployed Container
  2. See error

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context Fresh Deployed Container

MacVille avatar Sep 13 '25 22:09 MacVille

Having same issue. Here is the formatted error.

$ docker run -p 3000:3000   -v ./data:/app/data   dumbwareio/dumbpad:latest

> [email protected] start
> node server.js

ALLOWED ORIGINS: *
Asset manifest generated! [
  '/Assets/dumbpad.png',
  '/Assets/dumbpad.svg',
  '/Assets/preview-styles.css',
  '/Assets/styles.css',
  '/app.js',
  '/index.html',
  '/login.html',
  '/managers/collaboration.js',
  '/managers/confirmation.js',
  '/managers/cursor-manager.js',
  '/managers/operations.js',
  '/managers/preview.js',
  '/managers/search.js',
  '/managers/settings.js',
  '/managers/storage.js',
  '/managers/toaster.js',
  '/service-worker.js'
]
PWA manifest generated! {
  name: 'DumbPad',
  short_name: 'DumbPad',
  description: 'A simple notepad application',
  start_url: '/',
  display: 'standalone',
  background_color: '#ffffff',
  theme_color: '#000000',
  icons: [
    { src: 'dumbpad.png', type: 'image/png', sizes: '192x192' },
    { src: 'dumbpad.png', type: 'image/png', sizes: '512x512' }
  ],
  orientation: 'any'
}
Checking for notepad files to migrate...
Server is running on port 3000
Base URL: http://localhost:3000
Environment: production
Version: 1.0.4
Creating new notepads.json
Error initializing data directory: Error: EACCES: permission denied, open '/app/data/notepads.json'
    at async open (node:internal/fs/promises:641:25)
    at async Object.writeFile (node:internal/fs/promises:1215:14)
    at async ensureDataDir (/app/server.js:562:13)
    at async getNotepadsFromDir (/app/server.js:581:5)
    at async loadNotepadsList (/app/server.js:576:26)
    at async /app/server.js:739:22 {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/app/data/notepads.json'
}
node:internal/process/promises:394
    triggerUncaughtException(err, true /* fromPromise */);
    ^

Error: EACCES: permission denied, open '/app/data/notepads.json'
    at async open (node:internal/fs/promises:641:25)
    at async Object.writeFile (node:internal/fs/promises:1215:14)
    at async ensureDataDir (/app/server.js:562:13)
    at async getNotepadsFromDir (/app/server.js:581:5)
    at async loadNotepadsList (/app/server.js:576:26)
    at async /app/server.js:739:22 {
  errno: -13,
  code: 'EACCES',
  syscall: 'open',
  path: '/app/data/notepads.json'
}

Node.js v22.19.0
`

iamthefinch avatar Sep 13 '25 22:09 iamthefinch

@MacVille do chmod -R a+rw . in the same directory as the docker compose file.

iamthefinch avatar Sep 14 '25 12:09 iamthefinch

@MacVille do chmod -R a+rw . in the same directory as the docker compose file.

After chmod tha Container Started, is that an know issue or is that something with the base permissions?

MacVille avatar Sep 14 '25 15:09 MacVille

better solution: in my opinion, the solution of MacVille is a little bit unsafe, because everyone has permission on this directory. ssh in your server and

sudo docker exec -it "containeridfromdumbpad" id

you'll find "containeridfromdumbpad" using

sudo docker ps

Warning: Container must run! otherwise it will not be shown.

in most cases there comes something like this when you sudo docker exec :

uid=1000(node) gid=1000(node) groups=1000(node)

then ssh again:

sudo chown -R 1000:1000 /volume1/docker/dumbpad sudo chmod -R u+rwX /volume1/docker/dumbpad

now, only user 1000 has full access of your dumbpad directory.

control this with:

ls -lR /volume3/docker/dumbpad | head -20

there should come something like this: ls: cannot open directory '/volume1/docker/dumbpad': Permission denied

thats ok, because you locked your user out of this directory.

You can restore it with ssh:

id yourusername

the Result ist your uid and gid.

ssh:

sudo chown -R yourUID:yourGID /volume1/docker/dumbpad sudo chmod -R u+rwX /volume1/docker/dumbpad

now your user has full access again, but your dumbpad docker container won't and you'll get the same error message.

hope it works for you. and sorry, this is my first comment. didn't knew how to set up these cool code blocks.

saarcastic avatar Oct 30 '25 08:10 saarcastic

This should now be covered in the readme! thank you

abiteman avatar Nov 04 '25 03:11 abiteman