Skip to content

[2.2.7] Logs path is absolute? #1572

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

Closed
CiraciNicolo opened this issue Apr 20, 2016 · 8 comments
Closed

[2.2.7] Logs path is absolute? #1572

CiraciNicolo opened this issue Apr 20, 2016 · 8 comments
Assignees

Comments

@CiraciNicolo
Copy link

CiraciNicolo commented Apr 20, 2016

I'm using the latest versione of Parse-Server and I keep getting this error:

Error: EACCES: permission denied, open '/logs/parse-server.info.2016-04-20'
    at Error (native)

It seems that the logs path is absolute and not relative to the project, and the logs are created in the absolute path /logs/. My Parse instance is running through foreverjs, maybe this helps?

@drew-gross
Copy link
Contributor

It is. use __dirname in your config to construct an absolute path to a folder in your Parse Server project.

@CiraciNicolo
Copy link
Author

Not fixed, I set the logsFolder parameter to the absolute path of my Parse instance but Parse still creates the /logs directory in the root of the file system.

@flovilmart
Copy link
Contributor

flovilmart commented Apr 21, 2016

Where do you deploy? What's the path to you logs folder (configuration)? What's the behaviour locally?

@CiraciNicolo
Copy link
Author

I'm using Parse with expressjs on a virtual machine running the latest Ubuntu LTS. The logs path is passed through the constructor of ParseServer. The configuration is attached, personal data is blacked out. As I said before the logsFolder is ignored and new logs are created at /logs (file system root).

schermata 2016-04-21 alle 14 24 59

@flovilmart
Copy link
Contributor

I'll have a look

@CiraciNicolo
Copy link
Author

Can you reopen this issue then?

@flovilmart flovilmart reopened this Apr 21, 2016
@flovilmart flovilmart self-assigned this Apr 21, 2016
@huang1196
Copy link

Maybe the logs folder is created by foreverjs.

I start my server by:

forever start index.js -l /home/abc-user/logs/abc.log

@CiraciNicolo
Copy link
Author

CiraciNicolo commented Apr 27, 2016

Nope, here is the error with my instance running as www-data

fs.js:794
  return binding.mkdir(pathModule._makeLong(path),
                 ^

Error: EACCES: permission denied, mkdir '/logs'
    at Error (native)
    at Object.fs.mkdirSync (fs.js:794:18)
    at configureLogger (/var/www/xxxx/node_modules/parse-server/lib/logger.js:71:18)
    at Object.<anonymous> (/var/www/xxxx/node_modules/parse-server/lib/logger.js:80:1)
    at Module._compile (module.js:409:26)
    at Object.Module._extensions..js (module.js:416:10)
    at Module.load (module.js:343:32)
    at Function.Module._load (module.js:300:12)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
error: Forever detected script exited with code: 1

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

No branches or pull requests

4 participants