Coder Social home page Coder Social logo

Permission denied for mkdir about send HOT 4 CLOSED

timvisee avatar timvisee commented on July 18, 2024
Permission denied for mkdir

from send.

Comments (4)

timvisee avatar timvisee commented on July 18, 2024

This likely happens because the container uses a special user (to prevent running as root). Because of this, I don't think the container user has permission to the directory.

Would you mind to temporarily change the directory permission to 777, to test whether the error still comes up when everyone is allowed?

chmod -R 777 /mnt/hdd/ffsend

Note that this permission setting is considered insecure, and is just used for testing purposes here.

from send.

sysoppl avatar sysoppl commented on July 18, 2024

Yes, changed permissions:
obraz
and recreated docker. Same error

{"Timestamp":1618238514711000000,"Logger":"FirefoxSend","Type":"uncaughtException","Severity":0,"Pid":1,"EnvVersion":"2.0","Fields":{"error":"Error: EACCES: permission denied, mkdir '/mnt/hdd'","stack":"\n    at Object.mkdirSync (node:fs:1010:3)\n    at sync (/app/node_modules/mkdirp/index.js:72:13)\n    at Function.sync (/app/node_modules/mkdirp/index.js:78:24)\n    at new FSStorage (/app/server/storage/fs.js:12:12)\n    at new DB (/app/server/storage/index.js:22:20)\n    at Object.<anonymous> (/app/server/storage/index.js:86:18)\n    at Module._compile (node:internal/modules/cjs/loader:1108:14)\n    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)\n    at Module.load (node:internal/modules/cjs/loader:973:32)\n    at Function.Module._load (node:internal/modules/cjs/loader:813:14)"}}

from send.

timvisee avatar timvisee commented on July 18, 2024

Took another look at your command. It looks like you're missing a mount argument for the container.

-e 'FILE_DIR=/mnt/hdd/ffsend/' just tells Send in the container where to place files (from within the container context), this doesn't actually expose the specified directory from your host inside the container.

You likely have to add -v /mnt/hdd/ffsend:/mnt/hdd/ffsend to your command in order to mount the directory from the host system into the container. Note that you can specify a different path inside the container, such as /uploads if you so desire.

from send.

sysoppl avatar sysoppl commented on July 18, 2024

Oh, that was really stupid mistake I made. I really forgot to mount volume, my fault, sorry.

sudo docker create --name send \
  -e 'NODE_ENV=production' \

  -p 127.0.0.1:1234:1443 \

  -e 'PORT=1443:1443' \
  -e 'REDIS_HOST=1.2.3.4' \
  -e 'BASE_URL=https://url.com' \
  
  -v /mnt/hdd/ffsend:/mnt/hdd/ffsend \
  
  -e 'FILE_DIR=/mnt/hdd/send_data' \
  -e 'MAX_FILE_SIZE=10737420000' \
  -e 'MAX_EXPIRE_SECONDS=604800' \
  registry.gitlab.com/timvisee/send:latest && sudo docker start send

seems to work. Thanks!

from send.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.