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

No operations allowed until you send an INIT message successfully #119

Closed
teameh opened this issue Aug 10, 2016 · 11 comments
Closed

No operations allowed until you send an INIT message successfully #119

teameh opened this issue Aug 10, 2016 · 11 comments

Comments

@teameh
Copy link

teameh commented Aug 10, 2016

I'm getting this error but can't find any information except for the java file printing the error in the docs about this error.

Here's all my (ES 6) code:

import neo4j from 'neo4j-driver';

const neo4jv1 = neo4j.v1;
const driver = neo4jv1.driver('bolt://localhost', neo4jv1.auth.basic('neo4j', 'neo4j'));

const session = driver.session();
session.run('CREATE INDEX ON :Movie(id)')
  .then(function(result){
    console.log("result!");
    console.log(result);
    session.close();
    driver.close();
  })
  .catch(function(error) {
    console.log("error!");
    console.log(error);
    driver.close();
  });

And the output:

> fliq-api@0.1.0 db-init /home/fliq/fliq-api
> node dist/scripts/init-db

error!
Structure {
  signature: 127,
  fields:
   [ { code: 'Neo.ClientError.Request.Invalid',
       message: 'No operations allowed until you send an INIT message successfully.' } ] }

Anyone seen this error before?

@oskarhane
Copy link
Member

I've never seen that before. Can you connect to the database with Neo4j Browser?

@teameh
Copy link
Author

teameh commented Aug 11, 2016

Yeah the browser over http works fine.. Running the same script in my vagrant box also works fine but running it on a ubuntu VPS results in this error..

@zhenlineo
Copy link
Contributor

You see this error message because you have failed to log in to server with a correct authentication token. We've known the error is really bad as it hides the real error that it was and we have a bug fix card for this problem already.

Why we see this error? When running your example code, we sent INIT, RUN message to the server. INIT is for auth and RUN is for running the statement. Then what happens is that the INIT failed and server replied with an error to tell you why you failed. However the server also has a protection to disallow any more messages if INIT failed. So when the server see the second RUN, then it replied with this No operations allowed until you send an INIT message successfully, which is a really really bad protocol error to force to close the connection with the server.

We are working on a fix for this. Sorry for this misleading error message. All in all, you need to check if you got anything wrong with your auth token, a.k.a neo4j, neo4j. Try to do it via browser to see if this is your username and password. Also you should change your default password the first time that you connect to it.

@teameh
Copy link
Author

teameh commented Aug 11, 2016

Okay. Thanks for the heads up.

We indeed changed the default password the first time we connected to the browser. We changed it to h8g3q3ytMvUqL5QYgpidpyk8.

I just changed it back to neo4j and can connect with my application over bolt now. However, when I change it back to h8g3q3ytMvUqL5QYgpidpyk8 (and even restart neo4j) it fails again.. Password does work in the browser. Weird right?

@teameh
Copy link
Author

teameh commented Aug 11, 2016

Changing the password to something shorter also doesn't work..

@zhenlineo
Copy link
Contributor

That's strange. The driver cannot provide any other password other than neo4j?

I could only suggest that pls make sure that you changed all
const driver = neo4jv1.driver('bolt://localhost', neo4jv1.auth.basic('neo4j', 'neo4j'));
to
const driver = neo4jv1.driver('bolt://localhost', neo4jv1.auth.basic('neo4j', 'h8g3q3ytMvUqL5QYgpidpyk8'));

We will investigate if there is anything wrong with how we pass the password to the server over bolt.

@teameh
Copy link
Author

teameh commented Aug 11, 2016

Crap okay sorry you're right. Between all the testing I fucked up and I think I did not save the changed password. I can confirm that changing the password via the browser and then using it bolt works.

Thanks again for the explanation about INIT message. Shall I keep this issue open until you've changed the error message?

@zhenlineo
Copy link
Contributor

Okay, good to know it is not a new bug.
Yes, pls keep this open in case others might also hit this problem. We will also try to get a fix soon. Thanks a lot again.

@teameh
Copy link
Author

teameh commented Aug 12, 2016

No problem. Good luck with the issue.

@pontusmelke
Copy link
Contributor

pontusmelke commented Sep 7, 2016

Starting from 125 we now send INIT eagerly and should no longer see this misleading error message in the latest version of the driver. You can do driver. onError = function (err) {..} and driver.onCompleted = function(meta){...} to get quick feedback on the status of the connection.

Please reopen or open a new issue if you continue to see this error.

Regards,
Pontus

@teameh
Copy link
Author

teameh commented Sep 7, 2016

Great! Thanks.

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