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

Cron Error sync.js index update #83

Closed
theflu opened this issue Jul 13, 2017 · 4 comments
Closed

Cron Error sync.js index update #83

theflu opened this issue Jul 13, 2017 · 4 comments

Comments

@theflu
Copy link

theflu commented Jul 13, 2017

Coin: chaincoin
OS: Ubuntu 14.04

/home/chcuser/explorer/lib/explorer.js:252
    module.exports.syncLoop(array.length, function (loop) {
                                                   ^

RangeError: Maximum call stack size exceeded
    at /home/chcuser/explorer/lib/explorer.js:252:52
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at /home/chcuser/explorer/lib/explorer.js:260:14
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at /home/chcuser/explorer/lib/explorer.js:260:14
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at /home/chcuser/explorer/lib/explorer.js:260:14
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at /home/chcuser/explorer/lib/explorer.js:260:14
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at /home/chcuser/explorer/lib/explorer.js:260:14
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at /home/chcuser/explorer/lib/explorer.js:260:14
    at Object.next (/home/chcuser/explorer/lib/explorer.js:189:18)
    at Object.syncLoop (/home/chcuser/explorer/lib/explorer.js:205:10)
    at Object.is_unique (/home/chcuser/explorer/lib/explorer.js:252:20)
@theflu
Copy link
Author

theflu commented Jul 13, 2017

When this happens the PID file is not removed so the script thinks its already running. A better way to do this would be to take the PID and see if there is something running with that PID and if not remove the file and continue running.

@theflu
Copy link
Author

theflu commented Jul 13, 2017

I have created a bash script to do this before the script is launched

#!/bin/bash

file="/home/chcuser/explorer/tmp/index.pid"
if [ -f $file ]
  then
   name=$(cat "$file")

  if [ -z "${kpid}" -a -d "/proc/${kpid}" ]
    then
      rm /home/chcuser/explorer/tmp/index.pid
  fi
fi

and changed my cron to this

* * * * * cd /home/chcuser/explorer && ./scripts/pidcheck.sh && /usr/bin/nodejs scripts/sync.js index update > /dev/null 2>&1

@mddeepak
Copy link

mddeepak commented Jun 1, 2018

node scripts/sync.js index update
script launched with pid: 6952
C:\explorer\explorer\lib\database.js:642
lib.syncLoop(block.tx.length, function (subloop) {
^

TypeError: Cannot read property 'length' of undefined
at C:\explorer\explorer\lib\database.js:642:37
at Request._callback (C:\explorer\explorer\lib\explorer.js:107:14)
at Request.self.callback (C:\explorer\explorer\node_modules\request\request.
js:187:22)
at emitTwo (events.js:126:13)
at Request.emit (events.js:214:7)
at Request. (C:\explorer\explorer\node_modules\request\request.js
:1044:10)
at emitOne (events.js:116:13)
at Request.emit (events.js:211:7)
at IncomingMessage. (C:\explorer\explorer\node_modules\request\re
quest.js:965:12)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1064:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)

please give me any solution.

@TheHolyRoger
Copy link
Collaborator

Dup of #56

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

3 participants