ghost-on-heroku icon indicating copy to clipboard operation
ghost-on-heroku copied to clipboard

an error occurred unable to update nested relation. [object object]/Ghost Server Error

Open eltel opened this issue 3 years ago • 10 comments

Hi Guys

I think I'm in the right place - It's been going really smoothly, then from nowhere - an error occurred unable to update nested relation. [object object]

  • when trying to edit a page then a 'Ghost Server Error' -
    Ghost server error: insert into settings (created_at, created_by, id, key, type, updated_at, updated_by, value`) values ('2020-09-28 21:45:44', 1, '5f725988e7188c001e25ad0e', 'active_apps', 'app', '2020-09-28 21:45:44', 1, '[]') - ER_TABLEACCESS_DENIED_ERROR: INSERT command denied to user 'f5gan8ytezqkq9go'@'3.248.219.90' for table 'settings' Error: ER_TABLEACCESS_DENIED_ERROR: INSERT command denied to user 'f5gan8ytezqkq9go'@'3.248.219.90' for table 'settings'
  • when trying to upgrade - which is what was the most common advice for this error - which I retrieved from the heroku logs which finished with the standard -
2020-09-28T21:45:52.322147+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-09-28T21:45:52.322520+00:00 app[web.1]: npm ERR! errno 1
2020-09-28T21:45:52.325100+00:00 app[web.1]: npm ERR! [email protected] start: `node server.js`
2020-09-28T21:45:52.325206+00:00 app[web.1]: npm ERR! Exit status 1
2020-09-28T21:45:52.325353+00:00 app[web.1]: npm ERR!
2020-09-28T21:45:52.325440+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2020-09-28T21:45:52.325548+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-09-28T21:45:52.332858+00:00 app[web.1]: 
2020-09-28T21:45:52.333066+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-09-28T21:45:52.333214+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-09-28T21_45_52_326Z-debug.log
2020-09-28T21:45:52.378534+00:00 heroku[web.1]: Process exited with status 1
2020-09-28T21:45:52.404244+00:00 heroku[web.1]: State changed from starting to crashed
`

Error message, there's around 3 weeks of solid data entry in there and no backups can be imported back into Ghost which is, just great :( and this is linked up to a Gatsby front-end

Any help would be most appreciated, Google wasn't particularly helpful when searching out the error messages - as stated, most common advice was to upgrade, which led to the server error.

If I should be posting any other logs, just let me know and I'd be happy to oblige.

Cheers

Terry

eltel avatar Sep 28 '20 22:09 eltel

looks like generic db error

try google grant access to user for table

Prozi avatar Sep 28 '20 22:09 Prozi

What steps did you follow to perform the upgrade?

paulmelnikow avatar Sep 28 '20 22:09 paulmelnikow

Thanks @Prozi - I'll give it a shot

@paulmelnikow I followed the steps on the ReadMe on here, to the letter. It was bizarre, the first error came from nowhere, we've put in so much work on this - the 2nd as a result of the attempt to upgrade.

eltel avatar Sep 28 '20 22:09 eltel

Hummmm... My colleague has just confessed that he deleted a page that was being linked to - do you think that could have disabled the whole admin?

eltel avatar Sep 28 '20 22:09 eltel

Do you have the Heroku logs from the first startup after upgrading?

paulmelnikow avatar Sep 28 '20 22:09 paulmelnikow

Yes! Here - thanks for yr time.

terry@terry-VPCSB25FB:~/Desktop/Dev/projects/timeline-2020/ghostline-2/ghost-on-heroku$ git push heroku master
Counting objects: 495, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (244/244), done.
Writing objects: 100% (495/495), 239.11 KiB | 119.55 MiB/s, done.
Total 495 (delta 207), reused 495 (delta 207)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:        
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:        NODE_VERBOSE=false
remote:        
remote: -----> Installing binaries
remote:        engines.node (package.json):  10.x
remote:        engines.npm (package.json):   unspecified (use default)
remote:        
remote:        Resolving node version 10.x...
remote:        Downloading and installing node 10.22.1...
remote:        Using default npm version: 6.14.6
remote:        
remote: -----> Restoring cache
remote:        Cached directories were not restored due to a change in version of node, npm, yarn or stack
remote:        Module installation may take longer for this build
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules
remote:        
remote:        > [email protected] install /tmp/build_7c63e206/node_modules/sqlite3
remote:        > node-pre-gyp install --fallback-to-build
remote:        
remote:        [sqlite3] Success: "/tmp/build_7c63e206/node_modules/sqlite3/lib/binding/node-v64-linux-x64/node_sqlite3.node" is installed via remote
remote:        
remote:        > [email protected] install /tmp/build_7c63e206/node_modules/dtrace-provider
remote:        > node-gyp rebuild || node suppress-error.js
remote:        
remote:        make: Entering directory '/tmp/build_7c63e206/node_modules/dtrace-provider/build'
remote:          TOUCH Release/obj.target/DTraceProviderStub.stamp
remote:        make: Leaving directory '/tmp/build_7c63e206/node_modules/dtrace-provider/build'
remote:        
remote:        > [email protected] postinstall /tmp/build_7c63e206/node_modules/jsonpath
remote:        > node lib/aesprim.js > generated/aesprim-browser.js
remote:        
remote:        added 810 packages in 14.815s
remote:        
remote: -----> Build
remote:        
remote: -----> Caching build
remote:        - node_modules
remote:        
remote: -----> Pruning devDependencies
remote:        updated 1 package and audited 811 packages in 5.939s
remote:        found 320 vulnerabilities (196 low, 7 moderate, 115 high, 2 critical)
remote:          run `npm audit fix` to fix them, or `npm audit` for details
remote:        
remote: -----> Build succeeded!
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote: 
remote: -----> Compressing...
remote:        Done: 51.3M
remote: -----> Launching...
remote:        Released v14
remote:        https://timeline-cms.herokuapp.com/ deployed to Heroku
remote: 
remote: Verifying deploy... done.
To https://git.heroku.com/timeline-cms.git
 * [new branch]        master -> master

I think that's the relevant part -let me know if I've missed sth.

eltel avatar Sep 28 '20 22:09 eltel

...And maybe this:

terry@terry-VPCSB25FB:~/Desktop/Dev/projects/timeline-2020/ghostline-2/ghost-on-heroku$ heroku logs -t
2020-09-28T21:45:36.622628+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2020-09-28T21:45:36.659553+00:00 app[web.1]: [2020-09-28 21:45:36] WARN Ghost has shut down
2020-09-28T21:45:36.661252+00:00 app[web.1]: [2020-09-28 21:45:36] WARN Your site is now offline
2020-09-28T21:45:36.722079+00:00 heroku[web.1]: Process exited with status 143
2020-09-28T21:45:39.000000+00:00 app[api]: Build succeeded
2020-09-28T21:45:40.598373+00:00 heroku[web.1]: Starting process with command `npm start --production`
2020-09-28T21:45:42.536606+00:00 app[web.1]: 
2020-09-28T21:45:42.536626+00:00 app[web.1]: > [email protected] start /app
2020-09-28T21:45:42.536627+00:00 app[web.1]: > node server.js
2020-09-28T21:45:42.536627+00:00 app[web.1]: 
2020-09-28T21:45:44.090632+00:00 app[web.1]: Ghost server error: insert into `settings` (`created_at`, `created_by`, `id`, `key`, `type`, `updated_at`, `updated_by`, `value`) values ('2020-09-28 21:45:44', 1, '5f725988e7188c001e25ad0e', 'active_apps', 'app', '2020-09-28 21:45:44', 1, '[]') - ER_TABLEACCESS_DENIED_ERROR: INSERT command denied to user 'f5gan8ytezqkq9go'@'3.248.219.90' for table 'settings' Error: ER_TABLEACCESS_DENIED_ERROR: INSERT command denied to user 'f5gan8ytezqkq9go'@'3.248.219.90' for table 'settings'
2020-09-28T21:45:44.090655+00:00 app[web.1]: at Query.Sequence._packetToError (/app/node_modules/mysql/lib/protocol/sequences/Sequence.js:47:14)
2020-09-28T21:45:44.090656+00:00 app[web.1]: at Query.ErrorPacket (/app/node_modules/mysql/lib/protocol/sequences/Query.js:77:18)
2020-09-28T21:45:44.090656+00:00 app[web.1]: at Protocol._parsePacket (/app/node_modules/mysql/lib/protocol/Protocol.js:278:23)
2020-09-28T21:45:44.090657+00:00 app[web.1]: at Parser.write (/app/node_modules/mysql/lib/protocol/Parser.js:76:12)
2020-09-28T21:45:44.090658+00:00 app[web.1]: at Protocol.write (/app/node_modules/mysql/lib/protocol/Protocol.js:38:16)
2020-09-28T21:45:44.090658+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:91:28)
2020-09-28T21:45:44.090659+00:00 app[web.1]: at Socket.<anonymous> (/app/node_modules/mysql/lib/Connection.js:502:10)
2020-09-28T21:45:44.090659+00:00 app[web.1]: at Socket.emit (events.js:198:13)
2020-09-28T21:45:44.090660+00:00 app[web.1]: at addChunk (_stream_readable.js:288:12)
2020-09-28T21:45:44.090661+00:00 app[web.1]: at readableAddChunk (_stream_readable.js:269:11)
2020-09-28T21:45:44.090661+00:00 app[web.1]: at Socket.Readable.push (_stream_readable.js:224:10)
2020-09-28T21:45:44.090661+00:00 app[web.1]: at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:94:17)
2020-09-28T21:45:44.090662+00:00 app[web.1]: --------------------
2020-09-28T21:45:44.090663+00:00 app[web.1]: at Protocol._enqueue (/app/node_modules/mysql/lib/protocol/Protocol.js:144:48)
2020-09-28T21:45:44.090663+00:00 app[web.1]: at Connection.query (/app/node_modules/mysql/lib/Connection.js:200:25)
2020-09-28T21:45:44.090664+00:00 app[web.1]: at /app/node_modules/knex/lib/dialects/mysql/index.js:161:18
2020-09-28T21:45:44.090664+00:00 app[web.1]: at Promise._execute (/app/node_modules/bluebird/js/release/debuggability.js:303:9)
2020-09-28T21:45:44.090665+00:00 app[web.1]: at Promise._resolveFromExecutor (/app/node_modules/bluebird/js/release/promise.js:483:18)
2020-09-28T21:45:44.090665+00:00 app[web.1]: at new Promise (/app/node_modules/bluebird/js/release/promise.js:79:10)
2020-09-28T21:45:44.090665+00:00 app[web.1]: at Client_MySQL._query (/app/node_modules/knex/lib/dialects/mysql/index.js:155:12)
2020-09-28T21:45:44.090666+00:00 app[web.1]: at Client_MySQL.query (/app/node_modules/knex/lib/client.js:206:17)
2020-09-28T21:45:44.090666+00:00 app[web.1]: at Runner.<anonymous> (/app/node_modules/knex/lib/runner.js:155:36)
2020-09-28T21:45:44.090667+00:00 app[web.1]: at Runner.tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
2020-09-28T21:45:44.090667+00:00 app[web.1]: at Runner.query (/app/node_modules/bluebird/js/release/method.js:15:34)
2020-09-28T21:45:44.090668+00:00 app[web.1]: at /app/node_modules/knex/lib/runner.js:61:21
2020-09-28T21:45:44.090668+00:00 app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
2020-09-28T21:45:44.090669+00:00 app[web.1]: at /app/node_modules/bluebird/js/release/using.js:185:26
2020-09-28T21:45:44.090669+00:00 app[web.1]: at tryCatcher (/app/node_modules/bluebird/js/release/util.js:16:23)
2020-09-28T21:45:44.090669+00:00 app[web.1]: at Promise._settlePromiseFromHandler (/app/node_modules/bluebird/js/release/promise.js:512:31)
2020-09-28T21:45:44.104105+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2020-09-28T21:45:44.104631+00:00 app[web.1]: npm ERR! errno 1
2020-09-28T21:45:44.107712+00:00 app[web.1]: npm ERR! [email protected] start: `node server.js`
2020-09-28T21:45:44.107905+00:00 app[web.1]: npm ERR! Exit status 1
2020-09-28T21:45:44.108131+00:00 app[web.1]: npm ERR!
2020-09-28T21:45:44.108321+00:00 app[web.1]: npm ERR! Failed at the [email protected] start script.
2020-09-28T21:45:44.108513+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2020-09-28T21:45:44.115626+00:00 app[web.1]: 
2020-09-28T21:45:44.115844+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-09-28T21:45:44.116015+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-09-28T21_45_44_109Z-debug.log
2020-09-28T21:45:44.167920+00:00 heroku[web.1]: Process exited with status 1

eltel avatar Sep 28 '20 22:09 eltel

OK, I've successfully managed to import the data into a new Ghost deployment by editing default users and roles out of the imported JSON - but for future reference, I'd really like to know - could the DB actually be corrupted by deleting a page that's being linked to? It's the only thing that's happened that I'm aware of.

Thanks again for your time and speedy response! :)

edit: I deleted the link to the deleted page before the final data export and it seems to have fixed it, for now at least.

eltel avatar Sep 28 '20 23:09 eltel

Glad you solved it.

Most of what you've posted here is nearly unreadable due to formatting. For the benefit of other people who might see this, you could try to fix that. You can probably wrap the logs in triple backticks. Also formatting your message properly is a nice thing to do in the future when you're asking for help 😄

for future reference, I'd really like to know - could the DB actually be corrupted by deleting a page that's being linked to? It's the only thing that's happened that I'm aware of.

I imagine the Ghost forum might be a better place to get an answer to that.

paulmelnikow avatar Sep 28 '20 23:09 paulmelnikow

Yes, of course - sorry - it's been a while since I've been on here and I forgot to check the previews - I've been running around in panic all afternoon - I'll resolve that now.

Thanks again!

eltel avatar Sep 28 '20 23:09 eltel