grand-stack / grand-stack-starter

Simple starter project for GRANDstack full stack apps
https://grandstack.io/docs/getting-started-grand-stack-starter.html
Apache License 2.0
506 stars 161 forks source link

Cannot authenticate with default neo4j credentials #100

Closed Rjak closed 4 years ago

Rjak commented 4 years ago

The default neo4j/neo4j credentials result in the following error for me:

15:23:48 api | GraphQL server ready at http://0.0.0.0:4001/graphql
15:23:48 api | Database initialization failed to complete
15:23:48 api |  The client is unauthorized due to authentication failure.

I have created a new user for this database with :

CREATE USER foo
SET PASSWORD 'foobarbaz' CHANGE NOT REQUIRED
SET STATUS ACTIVE

But this user appears to lack other permissions:

  1. The webapp displays the text "ERROR" in several places.
  2. Seeding the database results in further permission errors:
Error: Error: GraphQL error: Creating new node label is not allowed for user 'projector' with roles [PUBLIC]. See GRANT CREATE NEW NODE LABEL ON DATABASE...
GraphQL error: Creating new node label is not allowed for user 'projector' with roles [PUBLIC]. See GRANT CREATE NEW NODE LABEL ON DATABASE...
GraphQL error: Creating new node label is not allowed for user 'projector' with roles [PUBLIC]. See GRANT CREATE NEW NODE LABEL ON DATABASE...
GraphQL error: There is no procedure with the name `apoc.cypher.doIt` registered for this database instance. Please ensure you've spelled the procedure name correctly and that the procedure is properly deployed.

I'm sure these are easy issues for experienced GRAND devs, but for someone new who is evaluating GRAND this is a lot of yak shaving and not filling me with a lot of confidence.

Rjak commented 4 years ago

I now have the starter app running correctly with no errors. Here were all the issues:

GRANT ROLE architect TO foobarbaz
To start your GRANDstack web application and GraphQL API run:

        cd projectorvs
        npm run start

Then (optionally) to seed the database with sample data, in another terminal run:

        cd api
        npm run seedDb

Since this is largely neo4j admin related I am tempted to close this issue, but I think grand-stack-starter needs to state things like this to save nub developers like me the afternoon it took to brain it all out.

ed42311 commented 4 years ago

@Rjak Thanks for the afternoon of :brain: Feel you on that one it's nice when docs match up...

As far as this https://github.com/grand-stack/grand-stack-starter/issues/91 goes:

Lastly, as has been pointed out in another issue, seeding the database must be executed from the api directory. The correct output in the terminal should ...

opened a PR to address the documentation along with a script to bridge into the api folder: https://github.com/grand-stack/grand-stack-starter/pull/104

Let me know you how think that reads.

Going to leave this open for now as there are some other issues to address in here, we'll get to them in turn. :smile_cat:

ed42311 commented 4 years ago

As far as this goes:

I have not confirmed it, but I strongly suspect that the above is required for a sandbox instance as well.

after creating a blank sandbox it looks like I have apoc functions by default: Screenshot from 2020-08-12 16-12-29

confirmed this with @johnymontana that

yeah sandbox has apoc and gds/algos by default

ed42311 commented 4 years ago

hey @Rjak updated readme to reflect the need for APOC plugin ( although I need to take some better pictures :laughing:)

Neo4j Desktop 1.3.3 OOTB does not have the APOC plugins installed. grand-stack-starter depends on them. Install them from Neo4j Desktop by clicking the empty (dotted outline) Plugins area and choosing APOC.

Was not able to repro the user errors you were seeing

Above I mentioned that grand-stack-starter failed to authenticate with my new neo4j database with the default credentials neo4j/neo4j. You need to create a new user and also grant that user architect...

  1. Neo4j Desktop 1.3.3
  2. New graph in new project with 4.1.1
  3. input creds in starter
  4. seedDb

Let me know if the updates for apoc install look good and we can close this out and start a new issue if the user/creds is still applicable. Any more information about environment would be greatly appreciated

ed42311 commented 4 years ago

Closing this with PR, feel free to open for clarification on creds and signin