Cannot read property 'then' of undefined



  • Hello,

    I can't connect the servers. That error shows when trying to.

    Disconnected
    unknown error from the peer
    Cannot read property 'then' of undefined

    xo-server 5.35.0
    xo-web 5.35.0
    yarn 1.12.3
    nodejs v8.12.0

    Source tree up to date, built without errors. Deleting and adding the servers again doesn't work, the same problem when trying to connect them.

    In syslog:

    Feb 17 12:55:53 xo xo-server[21077]: 2019-02-17T11:55:53.293Z - xo:main - [INFO] + WebSocket connection (::ffff:172.26.3.6)
    Feb 17 12:55:58 xo xo-server[21077]: 2019-02-17T11:55:58.680Z - xo:api - [WARN] xxx@xxx.xxx | server.connect(...) [10ms] =!> TypeError: Cannot read property 'then' of undefined
    Feb 17 12:55:58 xo xo-server[21077]: 2019-02-17T11:55:58.682Z - xo:xo-server - [ERROR] uncaught exception
    Feb 17 12:55:58 xo xo-server[21077]: { error: TypeError: Cannot read property 'cancel' of undefined
    Feb 17 12:55:58 xo xo-server[21077]:     at Timeout._onTimeout (/opt/xen-orchestra/node_modules/promise-toolbox/src/timeout.js:18:22)
    Feb 17 12:55:58 xo xo-server[21077]:     at ontimeout (timers.js:498:11)
    Feb 17 12:55:58 xo xo-server[21077]:     at tryOnTimeout (timers.js:323:5)
    Feb 17 12:55:58 xo xo-server[21077]:     at Timer.listOnTimeout (timers.js:290:5) }
    Feb 17 12:55:58 xo xo-server[21077]: node_redis: Deprecated: The HMSET command contains a argument of type Object.
    Feb 17 12:55:58 xo xo-server[21077]: This is converted to "[object Object]" by using .toString() now and will return an error from v.3.0 on.
    Feb 17 12:55:58 xo xo-server[21077]: Please handle this in your code to make sure everything works as you intended it to.
    

    Thanks!



  • This is a bug caused by a recent change in the source code. You can revert to a slightly earlier version of the code with something like this to avoid the error --

     git checkout HEAD~2  packages/xen-api/src/index.js
     yarn; yarn build
    sudo systemctl restart xo-server.service
    

    Adjust as needed depending on the method you used to build XO from source.



  • You can also just try rebuilding from the current source as they released a fix for this earlier today.



  • Hi @Danp

    Fixed by itself, yes 🙂 In that installation, I run a weekly auto-update.

    Thanks!

    Rubén.


Log in to reply