httpinternalservererror (http 500) unable to delete bosh image - openstack

I am trying to delete bosh images using glace image-delete command.
| b0e05888-9179-491c-b6c8-b8dde4d59d78 | BOSH-5b01cc67-c45d-498f-892f-965e3a003906 |
| b1a57b88-6487-4b31-afac-7b4e9cac40cb | BOSH-704b5bdc-cffa-4420-8a93-8489e7c5d1c7 |
| c99b9f15-7515-42ea-944d-76654dcdf319 | BOSH-a7f99575-96d1-4c0b-b385-3e48ce6debd1 |
I am able to delete first image but last two are throwing error httpinternalservererror (http 500) unable to delete image
I am using command glance image-delete imageid
All these images are from same owener 19070bc010034455ac2d8c52f1ba0f36.
glance version is 1.1.0
Please help me on this.
I again ran this command in debug mode.I am posting portion of the log
root#vms-inception-2:/opt/cisco/vms-installer/scripts# glance --debug image-delete 897bbe11-0d25-4509-9e01-ef2402c7b1a7
curl -g -i -X DELETE -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'User-Agent: python-glanceclient' -H 'Connection: keep-alive' -H 'X-Auth-Token: {SHA1}985eb4e6477f217212bb66a91ea5d9979996cdac' -H 'Content-Type: application/octet-stream' --cert None --key None https://us-virginia-1.cloud.cisco.com:9292/v2/images/897bbe11-0d25-4509-9e01-ef2402c7b1a7
Request returned failure status 500.
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/glanceclient/shell.py", line 700, in main
args.func(client, args)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/shell.py", line 321, in do_image_delete
gc.images.delete(args.id)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/v2/images.py", line 222, in delete
self.http_client.delete(url)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 292, in delete
return self._request('DELETE', url, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 272, in _request
resp, body_iter = self._handle_response(resp)
File "/usr/local/lib/python2.7/dist-packages/glanceclient/common/http.py", line 93, in _handle_response
raise exc.from_response(resp, resp.content)
HTTPInternalServerError: HTTPInternalServerError (HTTP 500)
HTTPInternalServerError (HTTP 500)

I was using delete script which will basically delete Cf and bosh installation.There was flaw in the script which deleted keypair first before deleting bosh images,bosh director.This could have caused this issue.
Moreover I deleted .bosh_config and .bosh_deploy_config file from /root and /home/ubuntu folder.This helped me deleting third bosh images.
..second one still couldn't be deleted.
I am using 1.1.0 version of glance for compatibility reason.seems this release has some bug for image create/deletion...hope this is rectified in 1.2.0 release...not sure on this ..:)

Related

Perform system import/export command line artifactory

I need to know how can I perform a sysyem export/import by command line by artifactory.
Is there any command that will do this task ?
My version of artifactory is 7.29
You can make use of the Import/Export REST API's for this purpose, like below,
Export full system:
curl -H 'Content-Type: application/json' -X POST https://myartifactory/api/export/system -d #export.json
Import full system:
curl -H 'Content-Type: application/json' -X POST https://myartifactory/api/import/system -d #export.json
Also, refer to this KB article on migrating the Arifactory via system import/export and replacing the UI operations with the REST APIs.

CURL chunked POST from infinite pipe?

I want to continuously post an infinite binary data stream to a webserver.
So I'm using the following command:
curl -X POST -H "Transfer-Encoding: chunked" -d 'hello' http://127.0.0.1:9000
As a test, I'm piping the output of the 'yes' command:
$ yes | curl -X POST -H "Transfer-Encoding: chunked" -d '#-' http://127.0.0.1:9000
But it doesn't even connect to the webserver, and aborts with an out-of-memory error. It seems curl is trying to read the whole file into memory before starting the transfer.
Does curl supports continuously HTTP posting data coming from a pipe? (I'm using curl version 7.61.0).
Thanks!
Try with
yes | curl -T. http://127.0.0.1:9000
But you will probably get this known bug :
https://github.com/curl/curl/issues/2051
https://github.com/curl/curl/issues/932
Or
yes | curl -T- http://127.0.0.1:9000

How can I set the version of a raw file in a (Sonatype) Nexus raw repository?

I'm making an automatic script to upload a raw file in Nexus, and I need to set up the version of this file. Is this possible? I've been checking the API but it doesn't seem posible.
The command I'm currently using to upload is:
curl --proxy $my-proxy -v --user 'user:pass' --upload-file ./myRawFile 'http://12.34.56.78:1234/repository/MyRawRepo/LoL/TheUploadedFile'
This command is being used from an automatic script (and working) to upload the file, but I don't know how to set the version.
curl -k -u "xxx:xxx" -H 'Content-Type: multipart/form-data' --data-binary "#output.zip" -X PUT https://nexus.xxx.com/repository/{raw-reponame}/xxx/{version}/output.zip
Version number can be change {version}

where to store request.json file

I am trying out Google video intelligent api by following the quick start guide here. I am using cloud shell to run all the codes. In the guide, to make an annotate video request, I need to create a request.json file.
Where to put this file once it's created?
Thanks very much for your help!
The request.json file in this case should be saved in the same directory that you'll make the curl request from in step 2 of that guide. The curl command points to that file at the end:
curl -s -H 'Content-Type: application/json' \
-H 'Authorization: Bearer ACCESS_TOKEN' \
'https://videointelligence.googleapis.com/v1beta1/videos:annotate' \
-d #request.json
The #request.json means it's looking in the current directory for the file.

FireBase, NEST. I can GET, but cannot PATCH using curl. Why am I getting a 400 error?

I am using the url at the developer-api.nest.com site, and my request is re-directed to the firebase-apiserver01...01.dapi.production.nest.com
I get the correct structured data back, using this dos command:
curl -v -k -L -X GET "https://developer-api.nest.com/structures/Za6hCZpmt4g6mBTaaA96yuY87lzLtsucYjbxW_b_thAuJJ7oUOelKA/?auth=c.om2...AeiE"
I get the error 'Invalid content sent' when I send this PATCH
curl -v -k -L -X PATCH "https://developer-api.nest.com/structures/Za6hCZpmt4g6mBTaaA96yuY87lzLtsucYjbxW_b_thAuJJ7oUOelKA/?auth=c.om2...AeiE" -H "Content-Type: application/json" -d '{"away":"home"}'
I have tried adding '.json' before the question mark, but get the same error.
To set the structure to home/away you'll need to send a PUT request for example as follows:
curl -v -L -X PUT "https://developer-api.nest.com/structures/g-9y-2xkHpBh1MGkVaqXOGJiKOB9MkoW1hhYyQk2vAunCK8a731jbg?auth=<AUTH_TOKEN>" -H "Content-Type: application/json" -d '{"away":"home"}'
Hope that helps
--Nagesh

Resources