vatesfr / xen-orchestra

The global orchestration solution to manage and backup XCP-ng and XenServer.
https://xen-orchestra.com
Other
750 stars 261 forks source link

backup report error (Cannot read property 'calls' of undefined) #3862

Closed renx123 closed 5 years ago

renx123 commented 5 years ago

Context

Expected behavior

Send backup report to email

Current behavior

Sending report fails with error: TypeError: Cannot read property 'calls' of undefined

Jan 14 15:53:06 xen-orchestra xo-server[10711]: backup report error: { TypeError: Cannot read property 'calls' of undefined
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at BackupReportsXoPlugin._listener (/usr/local/lib/node_modules/xo-server-backup-reports/src/index.js:69:19)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at /usr/local/lib/node_modules/xo-server-backup-reports/src/index.js:57:47
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Promise._execute (/opt/xen-orchestra/node_modules/bluebird/js/release/debuggability.js:313:9)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Promise._resolveFromExecutor (/opt/xen-orchestra/node_modules/bluebird/js/release/promise.js:483:18)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at new Promise (/opt/xen-orchestra/node_modules/bluebird/js/release/promise.js:79:10)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at BackupReportsXoPlugin._wrapper (/usr/local/lib/node_modules/xo-server-backup-reports/src/index.js:57:11)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at emitMany (events.js:147:13)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Xo.emit (events.js:224:7)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Xo.patchedEmit [as emit] (/opt/xen-orchestra/@xen-orchestra/log/src/configure.js:93:16)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at /opt/xen-orchestra/packages/xo-server/src/xo-mixins/jobs/index.js:317:10
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Generator.next (<anonymous>)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at asyncGeneratorStep (/opt/xen-orchestra/packages/xo-server/dist/xo-mixins/jobs/index.js:30:103)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at _next (/opt/xen-orchestra/packages/xo-server/dist/xo-mixins/jobs/index.js:32:194)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at tryCatcher (/opt/xen-orchestra/node_modules/bluebird/js/release/util.js:16:23)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Promise._settlePromiseFromHandler (/opt/xen-orchestra/node_modules/bluebird/js/release/promise.js:512:31)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Promise._settlePromise (/opt/xen-orchestra/node_modules/bluebird/js/release/promise.js:569:18)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Promise._settlePromise0 (/opt/xen-orchestra/node_modules/bluebird/js/release/promise.js:614:10)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Promise._settlePromises (/opt/xen-orchestra/node_modules/bluebird/js/release/promise.js:694:18)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at _drainQueueStep (/opt/xen-orchestra/node_modules/bluebird/js/release/async.js:138:12)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at _drainQueue (/opt/xen-orchestra/node_modules/bluebird/js/release/async.js:131:9)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Async._drainQueues (/opt/xen-orchestra/node_modules/bluebird/js/release/async.js:147:5)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at Immediate.Async.drainQueues (/opt/xen-orchestra/node_modules/bluebird/js/release/async.js:17:14)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at runCallback (timers.js:810:20)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at tryOnImmediate (timers.js:768:5)
Jan 14 15:53:06 xen-orchestra xo-server[10711]: at processImmediate [as _immediateCallback] (timers.js:745:5)

Other information

OS: centos7, backup-reports v0.7.0, transport-email 0.5.0

badrAZ commented 5 years ago

Hi!

Can you please try to send a backup NG log by putting its runId in the Backup report test field and clicking on Test plugin then verify if it fails with the same error?

image

Thank you!

renx123 commented 5 years ago

Hi!

I can't seem to find "test plugin" for backup reports. It is only avaliable to transport-email. Any suggestions if I am looking from wrong place?

image

badrAZ commented 5 years ago

Indeed, it's not available because the plugin Backup Report is not up to date and for this reason it's not working with the Backup NG jobs. Please update it to v0.15.0 to make it work.

renx123 commented 5 years ago

Ok thanks for the tip, it works now. I think the problem came from running npm install --global xo-server-backup-reports not inside xen-orchestra folder and it defaulted to npmjs.com repo that has old version (0.7).

olivierlambert commented 5 years ago

Yes please, fetch the updates from git directly.