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

Failure on user creation #3160

Closed
kostiag opened this issue Dec 2, 2016 · 12 comments
Closed

Failure on user creation #3160

kostiag opened this issue Dec 2, 2016 · 12 comments

Comments

@kostiag
Copy link

kostiag commented Dec 2, 2016

The following code results in:

Error generating response. ParseError { code: 101, message: 'Invalid username/password.' } code=101, message=Invalid username/password. - This is expected.

this I cannot figure out. it is almost as if the reason for 2nd failure is that it occurs right after first?
Removing the first failure allows creation to succeed.

[object Object]
/opt/bitnami/apps/parse/htdocs/node_modules/parse-server/lib/ParseServer.js:401
throw err;
^

Error: EACCES: permission denied, open '/opt/bitnami/apps/parse/htdocs/logs/parse-server.err.2016-12-02'
at Error (native)
error: Forever detected script exited with code: 7
error: Script restart attempt #1

` request.get({
url: SERVER_NAME + '/parse/login',
qs: {
username: username,
password: PARSE_USER_PASSWORD
},
headers: {
'X-Parse-Application-Id': PARSE_APP_ID,
'X-Parse-REST-API-Key': PARSE_API_KEY
}
},
function (err, response, body) {
if (err) return callback(err);
// user was found, add sessionToken to user profile
if (response.statusCode === 200) {
user.parse_session_token = JSON.parse(body).sessionToken;
return callback(null, user, context);
}

// Not found. Likely the user doesn’t exist, we provision one
if(response.statusCode === 404) {
//DOING THIS BY ITSELF WORKS
request.post({
url: SERVER_NAME + '/parse/users',
json: {
username: username,
password: PARSE_USER_PASSWORD,
email: email,
emailVerified: true
},
headers: {
'X-Parse-Application-Id': PARSE_APP_ID,
'X-Parse-REST-API-Key': PARSE_API_KEY,
'Content-Type': 'application/json'
}

},`

@flovilmart
Copy link
Contributor

That seems to be a problem with the logger that doesn't have write access to the logs folder.

@kostiag
Copy link
Author

kostiag commented Dec 2, 2016

This is just a side effect. The real issue that causes write to fail is login request followed by create request which actually fails.

@flovilmart
Copy link
Contributor

If you in locally on your machine, does it fail?

@kostiag
Copy link
Author

kostiag commented Dec 2, 2016

running it as a bitnami installation on AWS. Have not tried locally. Just to make it clear running just second part: `request.post({
url: SERVER_NAME + '/parse/users',
json: {
username: username,
password: PARSE_USER_PASSWORD,
email: email,
emailVerified: true
},
headers: {
'X-Parse-Application-Id': PARSE_APP_ID,
'X-Parse-REST-API-Key': PARSE_API_KEY,
'Content-Type': 'application/json'
}
})

works. This was a suggested solution for Auth0 and Parse integration which seemed to have worked at some point at least on parse.com.

@flovilmart
Copy link
Contributor

I believe this is an implementation detail that would be better suited for stackoverflow. Also, please run it locally as you don't know what's in the image you deployed.

Can you run with VERBOSE=1 to gather the server logs?

@kostiag
Copy link
Author

kostiag commented Dec 2, 2016

Yeah, I am thinking starting over... not sure what else to try at this point. Do not see anything in the logs, but will try VERBOSE, but something is not being releases given that works as 1 call and fails as 2 one after another.

@flovilmart
Copy link
Contributor

but something is not being releases given that works as 1 call and fails as 2 one after another.

the server is fully stateless, the controls don't hold any state. I'm not sure what's going on for you. You should probably run it locally and with VERBOSE=1 to investigate further.

@kostiag
Copy link
Author

kostiag commented Dec 8, 2016

FIGURED IT OUT! permission on log file creation were throwing and error that was causing server to shut down and miss the second call. Thank you.

@kostiag kostiag closed this as completed Dec 8, 2016
@ArMouReR
Copy link

kostiag,
Can you please share what you have actually did to fix this error ?

Thanks...

@kostiag
Copy link
Author

kostiag commented Feb 11, 2017

so as reported in my original post I was getting errors while writing to log files. This was the cause of the future server errors. I changed permissions +w on log directory and/or log files.

@gate3
Copy link

gate3 commented May 15, 2018

I am still having this issue. I am hosting on heroku, what i noiced is that the logs folder doesn't exist at all when I do heroku run bash. Any suggestions on how to fix this.

@flovilmart
Copy link
Contributor

@gate3 the issue was closed over a year ago. Please open a new issue

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