Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FilesCollection.ServiceFile] Path "/assets/app/uploads/ServiceFileCollection" is not writable! #866

Closed
ujjwalrg opened this issue Feb 22, 2023 · 2 comments
Labels

Comments

@ujjwalrg
Copy link

ujjwalrg commented Feb 22, 2023

I've reopened this issue as it was previously opened in issue#223. I followed the instructions there but wasn't able to resolve it.

For my production app, I manually changed the permission of the directory to make it work but I need to be able to set the configuration on the FilesCollection for CI.

Below is the error
"W20230219-18:19:24.667(0)? (STDERR) reason: '[FilesCollection.ServiceFile] Path "/assets/app/uploads/ServiceFileCollection" is not writable!',
W20230219-18:19:24.667(0)? (STDERR) details: Error: EACCES: permission denied, mkdir '/assets/app/uploads/ServiceFileCollection'
W20230219-18:19:24.668(0)? (STDERR) at Object.mkdirSync (fs.js:1014:3)
W20230219-18:19:24.668(0)? (STDERR) at new FilesCollection (packages/ostrio:files/server.js:350:10)
W20230219-18:19:24.668(0)? (STDERR) at module (imports/api/service/ServiceFiles.js:10:31)
W20230219-18:19:24.669(0)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)
W20230219-18:19:24.669(0)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)
W20230219-18:19:24.669(0)? (STDERR) at Module.moduleLink [as link] (/home/runner/.meteor/packages/modules/.0.18.0.j1mso2.mw1a++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/@meteorjs/reify/lib/runtime/index.js:52:22)
W20230219-18:19:24.669(0)? (STDERR) at module (server/main.js:1:276)
W20230219-18:19:24.669(0)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)
W20230219-18:19:24.669(0)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)
W20230219-18:19:24.669(0)? (STDERR) at require (packages/modules-runtime.js:258:21)
W20230219-18:19:24.669(0)? (STDERR) at /tmp/meteor-test-runlvnqsp.rlri8/.meteor/local/build/programs/server/app/app.js:4255:1
W20230219-18:19:24.669(0)? (STDERR) at /tmp/meteor-test-runlvnqsp.rlri8/.meteor/local/build/programs/server/boot.js:401:38
W20230219-18:19:24.669(0)? (STDERR) at Array.forEach ()
W20230219-18:19:24.670(0)? (STDERR) at /tmp/meteor-test-runlvnqsp.rlri8/.meteor/local/build/programs/server/boot.js:226:21
W20230219-18:19:24.670(0)? (STDERR) at /tmp/meteor-test-runlvnqsp.rlri8/.meteor/local/build/programs/server/boot.js:464:7
W20230219-18:19:24.670(0)? (STDERR) at Function.run (/tmp/meteor-test-runlvnqsp.rlri8/.meteor/local/build/programs/server/profile.js:280:14) {
W20230219-18:19:24.670(0)? (STDERR) errno: -13,
W20230219-18:19:24.670(0)? (STDERR) syscall: 'mkdir',
W20230219-18:19:24.670(0)? (STDERR) code: 'EACCES',
W20230219-18:19:24.670(0)? (STDERR) path: '/assets/app/uploads/ServiceFileCollection'
W20230219-18:19:24.670(0)? (STDERR) },
W20230219-18:19:24.670(0)? (STDERR) errorType: 'Meteor.Error'"

Below is the config:
"const ServiceFileCollection = new FilesCollection({
schema: mySchema,
storagePath: '/assets/app/uploads/ServiceFileCollection',
// downloadRoute: '/files/ServiceFile',
collectionName: 'ServiceFile',
// // permissions: 0o774,
// parentDirPermissions: 0o774,
// permissions: 0o755,
permissions: 0o774,
parentDirPermissions: 0o774,
allowClientCode: false,
cacheControl: 'public, max-age=31536000',
// Read more about cacheControl: https://devcenter.heroku.com/articles/increasing-application-performance-with-http-cache-headers
onbeforeunloadMessage() {
console.log(
'Upload is still in progress! Upload will be aborted if you leave this page!'
);"

I'm using Meteor 2.7.3.

Note: Even if I try permissions: 0o777 and parentDirPermissions: 0o777, it does not work.

@dr-dimitru
Copy link
Member

Hello @ujjwalrg,

Couple of options

  1. Create directory and make it writable as part of CI instructions before the launch of Meteor app
  2. Use default (e.g. void 0) value when running in CI environment

Perhaps you have solved it on your own?

@ujjwalrg
Copy link
Author

Ok, thanks. I'll try that. Just wanted to make sure there isn't anything wrong with my configs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants