Can't start server "Access denied for user ..."
Hey, I'm using openSUSE 15.1 Leap and I am trying to selfhost standardnotes, but syncing-server-js cant start. Here are logs:
syncing-server-js_1 | Starting Web...
syncing-server-js_1 | yarn run v1.22.5
syncing-server-js_1 | $ node dist/bin/server.js
syncing-server-js_1 | {"v":0,"level":30,"name":"newrelic_bootstrap","hostname":"d10b79b28243","pid":29,"time":"2021-06-10T19:49:34.109Z","msg":"NEW_RELIC_NO_CONFIG_FILE set, deferring to environment variables."}
syncing-server-js_1 | {"v":0,"level":30,"name":"newrelic_bootstrap","hostname":"d10b79b28243","pid":29,"time":"2021-06-10T19:49:36.332Z","msg":"NEW_RELIC_NO_CONFIG_FILE set, deferring to environment variables."}
syncing-server-js_1 | INFO: All classes found using provided glob pattern "dist/migrations/*.js" : "dist/migrations/1606470249552-init_database.js,dist/migrations/1617615657558-add_extension_settings.js"
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | [Error] PoolCluster : Error: Access denied for user 'std_notes_user'@'172.18.0.4' (using password: YES)
syncing-server-js_1 | /var/www/node_modules/mysql2/lib/pool_cluster.js:36
syncing-server-js_1 | return cb(new Error('Pool does Not exists.'));
syncing-server-js_1 | ^
syncing-server-js_1 |
syncing-server-js_1 | Error: Pool does Not exists.
syncing-server-js_1 | at PoolNamespace.getConnection (/var/www/node_modules/mysql2/lib/pool_cluster.js:36:17)
syncing-server-js_1 | at /var/www/node_modules/mysql2/lib/pool_cluster.js:43:21
syncing-server-js_1 | at /var/www/node_modules/mysql2/lib/pool_cluster.js:210:18
syncing-server-js_1 | at /var/www/node_modules/mysql2/lib/pool.js:60:18
syncing-server-js_1 | at PoolConnection.<anonymous> (/var/www/node_modules/mysql2/lib/connection.js:739:13)
syncing-server-js_1 | at Object.onceWrapper (node:events:485:26)
syncing-server-js_1 | at PoolConnection.emit (node:events:390:22)
syncing-server-js_1 | at PoolConnection.EventEmitter.emit (node:domain:470:12)
syncing-server-js_1 | at PoolConnection._notifyError (/var/www/node_modules/mysql2/lib/connection.js:225:12)
syncing-server-js_1 | at ClientHandshake.<anonymous> (/var/www/node_modules/mysql2/lib/connection.js:114:14)
syncing-server-js_1 | error Command failed with exit code 1.
syncing-server-js_1 | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
syncing-server-js_1 | db (172.18.0.3:3306) open
syncing-server-js_1 | db:3306 is up - executing command
syncing-server-js_1 | cache (172.18.0.2:6379) open
syncing-server-js_1 | cache:6379 is up - executing command
syncing-server-js_1 | Starting Web...
syncing-server-js_1 | yarn run v1.22.5
I have tried reinstalling, granting std_notes_user premmisions but nothing works. I am able to log to mysql "mysql" docker container using std_notes_user and changeme123 pass. I didn't change anything in .env.
Hey @famouzkk a couple of questions:
- are you running your MySQL server instance outside of the docker setup we provide
- is this a fresh "install" and you do not have any previously existing data?
- are you running the setup from
https://github.com/standardnotes/syncing-server-jsorhttps://github.com/standardnotes/standalone? - can you paste all your logs in a file from when the infrastructure starts up?
- can you paster all the servies versions you have in your setup
Hey, I'm not running any other mysql instance and any other docker instances. I am on fresh openSUSE 15.1 install. I'm using standalone repo. What u mean by services versions? My docker is 19.03.11_ce-lp151.2.18.1, my docker-compose version:
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
I have fixed "Access denied" by running:
GRANT ALL PRIVILEGES ON *.* TO 'std_notes_user'@'X' IDENTIFIED BY 'changeme123' WITH GRANT OPTION;
GRANT ALL PRIVILEGES ON `standard_notes_db`.* TO 'std_notes_user'@'X' WITH GRANT OPTION;
FLUSH PRIVILEGES;
where X is IP showing in Access denied for user 'std_notes_user'@'X'. I had to do it multiple times for different IP's.
Now everything works, I am really curious why using wildcard 'std_notes_user'@'%' didn't work.
I confirm this. Have the same issue. Fix from above doesn't work for me tho