ronivay / XenOrchestraInstallerUpdater

Xen Orchestra install/update script
GNU General Public License v3.0
1.16k stars 189 forks source link

Backup proxy deploys and connection is working but can't backup #111

Closed bogdantomasciuc closed 2 years ago

bogdantomasciuc commented 2 years ago

Hello!

This is not related to the install. It works spectacularly, the proxy installs and I am able to import the config inside the main XO vm. I can also add NFS remotes trom the remote site to the imported proxy and the remotes seem to work fine (the test completes ok). I can also see the remote mounted on the proxy. The problem appears whenever I try to make a backup. Every time it instantly fails with the message bellow.

{ "code": -32000, "message": "unknown error from the peer" }

I tried to debug the message but can't track down the reason. Any help is greatly appreciated!

bogdantomasciuc commented 2 years ago

The install is pure. Nothing is touched except i added in the config toml hostname = '0.0.0.0' for ipv4 traffic. My router blocks ipv6.

bogdantomasciuc commented 2 years ago

I think I might have tracked the reason. Any chance this can be fixed or somehow avoided?

Mar 29 17:41:58 xo xo-proxy[27587]: 2022-03-29T14:41:58.252Z xo:proxy:api WARN call error {
Mar 29 17:41:58 xo xo-proxy[27587]:   method: 'appliance.updater.getState',
Mar 29 17:41:58 xo xo-proxy[27587]:   params: undefined,
Mar 29 17:41:58 xo xo-proxy[27587]:   error: ErrorEvent {
Mar 29 17:41:58 xo xo-proxy[27587]:     [Symbol(kTarget)]: WebSocket {
Mar 29 17:41:58 xo xo-proxy[27587]:       _events: [Object: null prototype] {},
Mar 29 17:41:58 xo xo-proxy[27587]:       _eventsCount: 0,
Mar 29 17:41:58 xo xo-proxy[27587]:       _maxListeners: undefined,
Mar 29 17:41:58 xo xo-proxy[27587]:       _binaryType: 'nodebuffer',
Mar 29 17:41:58 xo xo-proxy[27587]:       _closeCode: 1006,
Mar 29 17:41:58 xo xo-proxy[27587]:       _closeFrameReceived: false,
Mar 29 17:41:58 xo xo-proxy[27587]:       _closeFrameSent: false,
Mar 29 17:41:58 xo xo-proxy[27587]:       _closeMessage: <Buffer >,
Mar 29 17:41:58 xo xo-proxy[27587]:       _closeTimer: null,
Mar 29 17:41:58 xo xo-proxy[27587]:       _extensions: {},
Mar 29 17:41:58 xo xo-proxy[27587]:       _paused: false,
Mar 29 17:41:58 xo xo-proxy[27587]:       _protocol: '',
Mar 29 17:41:58 xo xo-proxy[27587]:       _readyState: 3,
Mar 29 17:41:58 xo xo-proxy[27587]:       _receiver: null,
Mar 29 17:41:58 xo xo-proxy[27587]:       _sender: null,
Mar 29 17:41:58 xo xo-proxy[27587]:       _socket: null,
Mar 29 17:41:58 xo xo-proxy[27587]:       _bufferedAmount: 0,
Mar 29 17:41:58 xo xo-proxy[27587]:       _isServer: false,
Mar 29 17:41:58 xo xo-proxy[27587]:       _redirects: 0,
Mar 29 17:41:58 xo xo-proxy[27587]:       _url: 'ws://localhost:9001',
Mar 29 17:41:58 xo xo-proxy[27587]:       _req: null,
Mar 29 17:41:58 xo xo-proxy[27587]:       [Symbol(kCapture)]: false
Mar 29 17:41:58 xo xo-proxy[27587]:     },
Mar 29 17:41:58 xo xo-proxy[27587]:     [Symbol(kType)]: 'error',
Mar 29 17:41:58 xo xo-proxy[27587]:     [Symbol(kError)]: Error: connect ECONNREFUSED 127.0.0.1:9001
Mar 29 17:41:58 xo xo-proxy[27587]:         at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1159:16)
Mar 29 17:41:58 xo xo-proxy[27587]:         at TCPConnectWrap.callbackTrampoline (internal/async_hooks.js:130:17) {
Mar 29 17:41:58 xo xo-proxy[27587]:       errno: -111,
Mar 29 17:41:58 xo xo-proxy[27587]:       code: 'ECONNREFUSED',
Mar 29 17:41:58 xo xo-proxy[27587]:       syscall: 'connect',
Mar 29 17:41:58 xo xo-proxy[27587]:       address: '127.0.0.1',
Mar 29 17:41:58 xo xo-proxy[27587]:       port: 9001
Mar 29 17:41:58 xo xo-proxy[27587]:     },
Mar 29 17:41:58 xo xo-proxy[27587]:     [Symbol(kMessage)]: 'connect ECONNREFUSED 127.0.0.1:9001'
Mar 29 17:41:58 xo xo-proxy[27587]:   }
ronivay commented 2 years ago

Hi,

Sorry for delay on this. Looks like bypassing the proxy license check isn't anymore possible without modifying the code (which i don't want to do). It fails because it attempts to connect to updater, which does the license check. Something that runs only in official XOA. I've been trying to figure out why this change was done and if there's any proper way around it. Will get back to this once i have more information.

ronivay commented 2 years ago

Yeah got a confirmation that it isn't possible to run proxy without license check anymore without touching the code. Hopefully there will soon be a real documented procedure how to use proxy with "from sources" XO installations but until then this is where we're at.

Let's see if i can implement the minor source code change. Even though i'm against editing the source code with this script, but it's the only way to get this working currently.

ronivay commented 2 years ago

There's a workaround now in place. Just run proxy update with xo-install.sh against your existing proxy installation and it should work again. Let me know how it goes.

bogdantomasciuc commented 2 years ago

Works splendid! Great job! Thank you!