Project

General

Profile

Bug #23789

response payload after successful POST request is empty and entry in database becomes null

Added by Vaibhav Chauhan over 4 years ago. Updated almost 4 years ago.

Status:
Closed: Behaves correctly
Priority:
No priority
Assignee:
Marcelo Araujo
Category:
Middleware
Target version:
Severity:
New
Reason for Closing:
Reason for Blocked:
Needs QA:
Yes
Needs Doc:
Yes
Needs Merging:
Yes
Needs Automation:
No
Support Suite Ticket:
n/a
Hardware Configuration:
ChangeLog Required:
No

Description

so I have the following Request/Response when I try to edit a VM device

Request URL : http://localhost:3000/api/v1.0/vm/device/38/
Request Method: PUT
Status Code:200 OK

Request Payload: {"attributes":{"vnc_port":"7002","wait_on_boot":true},"dtype":"VNC","vm":"34"}

Response: {"attributes": {"vnc_port": "", "wait": false}, "dtype": "VNC", "id": 38, "pk": "38", "vm": "34"}

I am not seeing the correct value coming back from the backend

I am using webui:ui_vm_3 branch, it has all my type script changes.

History

#1 Updated by Vaibhav Chauhan over 4 years ago

#2 Updated by Marcelo Araujo over 4 years ago

  • Status changed from Unscreened to Screened

#3 Updated by Suraj Ravichandran over 4 years ago

  • Assignee changed from Marcelo Araujo to Suraj Ravichandran

Marcello is overloaded with a lot of ticket, so I will try and tackle this one in my remaining days before vacation.

Spoke with him about this and we are on the same page, to give him credit where it is due, these are the things he tried so far:

Marcelo Araujo, [11-May-2017, 1:16 AM]:
I get the data at api/resources.py class DeviceResourceMixin
I made a hydrate method there just to handle the data, to make sure the data arrives in the API.
from there I call vm.update and pass the data with the right format to the middleware
on the middlewared/plugins/vm.py I can see the data land in the right format at do_update() method
and it pass the data to do_update_devices() method that call datastore.update and returns True.
but, it is not updated in the database..

#4 Updated by Suraj Ravichandran over 4 years ago

  • Status changed from Screened to Unscreened
  • Assignee changed from Suraj Ravichandran to Vaibhav Chauhan

Me and vb figured it out.

It is techinically the middleware (specifically django's fault).

I am in a bit of a hurry for now, but have figured out a workaround to solve this via the gui payload modification.

I shall paste a detailed explanation on this in a day or two.

Till then since I have this working for now, I shall leave the rest of this ticket to Vaibhav

#5 Updated by Suraj Ravichandran over 4 years ago

  • Target version changed from 11.0 to 11.0-RC2

#6 Updated by Vaibhav Chauhan over 4 years ago

  • Status changed from Unscreened to Screened
  • Assignee changed from Vaibhav Chauhan to Marcelo Araujo
  • Priority changed from Expected to Important
  • Target version changed from 11.0-RC2 to 11.1

I have worked around this issue on the GUI side, I would like this to be fixed in a more proper way, at some point in time.

#7 Updated by Marcelo Araujo over 4 years ago

Vaibhav Chauhan wrote:

I have worked around this issue on the GUI side, I would like this to be fixed in a more proper way, at some point in time.

Great, could you point out the commit where you worked around it?
I think, we should try to use WEBSOCKET for VM modules and goes directly via middlewared. WDYT?

#8 Updated by Vaibhav Chauhan over 4 years ago

Marcelo Araujo wrote:

Vaibhav Chauhan wrote:

I have worked around this issue on the GUI side, I would like this to be fixed in a more proper way, at some point in time.

Great, could you point out the commit where you worked around it?

webui: commit aeb79957bd01ead4922bdd68777a59283a7d8a5a

I think, we should try to use WEBSOCKET for VM modules and goes directly via middlewared. WDYT?

I think if we can use the WebSockets on the UI side, that would be nice but rewriting this UI with again websockets in near future would be not on my priority list.

#9 Updated by Marcelo Araujo over 4 years ago

Vaibhav Chauhan wrote:

Marcelo Araujo wrote:

Vaibhav Chauhan wrote:

I have worked around this issue on the GUI side, I would like this to be fixed in a more proper way, at some point in time.

Great, could you point out the commit where you worked around it?

webui: commit aeb79957bd01ead4922bdd68777a59283a7d8a5a

I think, we should try to use WEBSOCKET for VM modules and goes directly via middlewared. WDYT?

I think if we can use the WebSockets on the UI side, that would be nice but rewriting this UI with again websockets in near future would be not on my priority list.

You don't need to rewrite all of it just to have websocket support.

Best,

#10 Updated by Vaibhav Chauhan over 4 years ago

I think this is not relevant anymore as I am using websocket call instead of rest API's for my task. but this ticket should be resolved anyhow.

#11 Updated by Vaibhav Chauhan over 4 years ago

#12 Updated by Marcelo Araujo over 4 years ago

  • Priority changed from Important to No priority

I will set it with a low priority as we are using websocket.

#13 Avatar?id=14398&size=24x24 Updated by Kris Moore almost 4 years ago

  • Target version changed from 11.1 to 11.1-U1

#14 Updated by Marcelo Araujo almost 4 years ago

  • Status changed from Screened to Closed: Behaves correctly

We are using pure websocket for VM feature in the new UI.

#15 Updated by Dru Lavigne almost 4 years ago

  • Target version changed from 11.1-U1 to N/A

Also available in: Atom PDF