-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting a response of 500 when attempting to create asset with asset_class specified. #792
Comments
@vigneshhari @iamsdas still getting 500 as response :/ |
@rithviknishad have you pulled the latest changes from the master branch? It seems to be working fine for me locally (using the Swagger UI). Also, check if you are providing the necessary input fields. Here's the request body I used for testing:
|
@iamsdas I'm using the staging API via proxy mentioned in I'm yet to setup a local care BE on my machine.
curl 'https://careapi.coronasafe.in/api/v1/asset/' \
-X POST \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-US,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjU0MjU4MjY5LCJqdGkiOiIwZjgyMTQ5Mzc4MjY0ZWUyYTJmNzVlNDFmYzllMmRjMSIsInVzZXJfaWQiOjIwMn0.gp1grpzzKDH3ZCPoRSI_XTLX-IoZnWDATUcZQpolwuU' \
-H 'Origin: http://localhost:4000' \
-H 'Connection: keep-alive' \
-H 'Referer: http://localhost:4000/facility/4fa7d5bf-1862-4ebb-b2d1-8284d12185ac/assets/new' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
--data-raw '
{
"name": "Hello Asset :wave:",
"asset_type": "INTERNAL",
"asset_class": "ONVIF",
"description": "",
"is_working": "true",
"not_working_reason": "",
"serial_number": "",
"warranty_details": "",
"location": "afa28ab1-53f5-4554-8cb0-77c1e5d58c37",
"vendor_name": "",
"support_name": "",
"support_email": "",
"support_phone": "+917777777777",
"qr_code_id": "",
"cancelToken": {
"promise": {}
}
}'
curl 'https://careapi.coronasafe.in/api/v1/asset/' \
-X POST \
-H 'User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0' \
-H 'Accept: application/json, text/plain, */*' \
-H 'Accept-Language: en-US,en;q=0.5' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbl90eXBlIjoiYWNjZXNzIiwiZXhwIjoxNjU0MjU4MjY5LCJqdGkiOiIwZjgyMTQ5Mzc4MjY0ZWUyYTJmNzVlNDFmYzllMmRjMSIsInVzZXJfaWQiOjIwMn0.gp1grpzzKDH3ZCPoRSI_XTLX-IoZnWDATUcZQpolwuU' \
-H 'Origin: http://localhost:4000' \
-H 'Connection: keep-alive' \
-H 'Referer: http://localhost:4000/facility/4fa7d5bf-1862-4ebb-b2d1-8284d12185ac/assets/new' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Sec-Fetch-Site: same-origin' \
--data-raw '
{
"name": "Hello Asset :wave:",
"asset_type": "INTERNAL",
"description": "",
"is_working": "true",
"not_working_reason": "",
"serial_number": "",
"warranty_details": "",
"location": "afa28ab1-53f5-4554-8cb0-77c1e5d58c37",
"vendor_name": "",
"support_name": "",
"support_email": "",
"support_phone": "+917777777777",
"qr_code_id": "",
"cancelToken": {
"promise": {}
}
}' |
The asset_class expects an integer |
Weren't the migrations run automatically? It's a char field in the last change. |
It's waiting for deployment https://github.com/coronasafe/care/deployments/activity_log?environment=Staging-egov @mathew-alex @tomahawk-pilot can you update the staging to deploy automatically? |
We can but let it be there. Since we have multiple instances being deployed to |
@tomahawk-pilot I'm asking auto deployments only for Staging-egov, If the review requirement could be removed for |
Feel free to remove the review requirements for staging egov environment |
I don't have the privileges for it. |
@sainak - I have removed the review requirements for staging egov environment. 👍 |
Steps to reproduce the behavior:
asset_class
attribute included with a valid value (eg: "ONVIF" / "HL7MONITOR")Expected behavior
201 Response
Screenshots
However, endpoint works fine when
asset_class
is not included.The text was updated successfully, but these errors were encountered: