vatesfr / xen-orchestra

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

Adding server 2nd time does not work #1598

Closed g4challenge closed 7 years ago

g4challenge commented 7 years ago

Context

Adding a server should work, even if the server has been connected before, deleted and now will be added again.

Current behavior

Message that tells me the server is already existing:

{
  "message": "server already exists",
  "stack": "Error: server already exists\n    at Servers._callee$ (/source/models/server.js:17:12)\n    at tryCatch (/usr/local/lib/node_modules/xo-server/node_modules/regenerator-runtime/runtime.js:62:40)\n    at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/xo-server/node_modules/regenerator-runtime/runtime.js:336:22)\n    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/usr/local/lib/node_modules/xo-server/node_modules/regenerator-runtime/runtime.js:95:21)\n    at step (/usr/local/lib/node_modules/xo-server/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)\n    at /usr/local/lib/node_modules/xo-server/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:20\n    at run (/usr/local/lib/node_modules/xo-server/node_modules/core-js/library/modules/es6.promise.js:87:22)\n    at /usr/local/lib/node_modules/xo-server/node_modules/core-js/library/modules/es6.promise.js:100:28\n    at flush (/usr/local/lib/node_modules/xo-server/node_modules/core-js/library/modules/_microtask.js:18:9)"
} 
julien-f commented 7 years ago

That's very weird, because I am removing and adding back my servers all the time, never had this kind of problem.

olivierlambert commented 7 years ago

I suppose it's related to the way a host has been into a pool and moved back or something like that.

julien-f commented 7 years ago

@g4challenge If you could provide a step-by-step recipe to reproduce, it would be a great help :)

g4challenge commented 7 years ago
  1. Added the Server
  2. The ip address of all servers changed due to some major network refactoring
  3. The server was in the menu, but of course it could not connect as there was the wrong ip entered
  4. corrected the Ip in the menu
  5. still could not connect to the machine, therefore removed the machine from Xenorchestra by clicking delete.
  6. when trying to add it again, it is not possible. I think there might be some data left somewhere, which are now checked but not displayed to me for deletion
julien-f commented 7 years ago

Cannot reproduce. @olivierlambert?

olivierlambert commented 7 years ago

Okay, found something: when you modify the IP in the UI, it's modified in our database, but xo-server will continue to try to connect with the "old" until it's restarted.

@g4challenge can you restart xo-server and tell me if it solves your issue?

g4challenge commented 7 years ago

i restarted the appliance, but still the issue is persisting,.... is there any way to clear the cache/database?

julien-f commented 7 years ago

Yes it's possible to clear the application database (redis-cli FLUSHALL), but it would be better for us to be able to reproduce, understand and fix the issue :)

olivierlambert commented 7 years ago

I think it could worth the try to display the list of saved servers via xo-cli

What do you think @julien-f ?

julien-f commented 7 years ago

Yeah, sure, @g4challenge, could you check the server list using xo-cli to see if the old IP is still there?

> npm install -g xo-cli
> xo-cli --register https://xo.company.tld admin@admin.net password
> xo-cli server.getAll

If you want us to take a look at the result without divulging it publicly, you can either add it in HTML comment in your next message (<!-- secret message -->) or send it to us via email.

olivierlambert commented 7 years ago

@g4challenge any news regarding this?

g4challenge commented 7 years ago

setting up a new instance solved it, could not find anything special in the cli. Thanks