C3W1 Programming Assignment: AuthError (original) (raw)
February 10, 2025, 12:12am 1
Hello, am receiving an AuthError when running the code in section 2.2
Have removed the https, port number, and colon from the NEO4JHOST as instructed in other posts for similar issue.
query = “MATCH (n) RETURN n LIMIT 20”
records = execute_query(query)
print(records)
Hello @ConnorCSB
Please, check the following items.
- For the
NEO4JHOST
variable in the env file, you have used the value corresponding toNeo4jDNSConnection
from CloudFormation, notNeo4jDNSUI
. - If you’re using a new lab session, the
NEO4JHOST
variable contains the value from the last session and should be updated. - You have saved the changes made to the env file and run the following cell afterwards.
- All other variables contain the correct values in the env file. It should look like this.
ConnorCSB February 10, 2025, 2:29pm 3
Hey @Amir_Zare, confirmed all 4 items. Resolved the issue by change the ‘username’ and ‘password’ from lowercase to uppercase ‘USERNAME’ and ‘PASSWORD’ in the previous code. Not sure if I accidentally changed that at some point or if it defaults to lowercase. Nonetheless, issue resolved and thanks for the reply!
Original: URI = # Add your database credentials in the format: (username, password)
AUTH = (os.getenv(‘username’), os.getenv(‘password’))
New: URI = # Add your database credentials in the format: (username, password)
AUTH = (os.getenv(‘USERNAME’), os.getenv(‘PASSWORD’))