Openstack Image create fails "ConflictException: 409: Client Error for url: https://x.x.x.x:9292/v2/images/8f78f59e-0b60-477e-aec6-810af4646c69/file - openstack-glance

I just upgraded from OSA-Rocky to OSA-Stein and everything seems to work fine except when I try and upload an image via the python-openstackclient CLI. We are running ceph nautilus as our storage. Running the --debug option on the command gives the following:
###Cut majority of debug messages###
Starting new HTTPS connection (2): xxx.xxx.xxx.xxx:9292
[> ] 1%https://xxx.xxx.xxx.xxx:9292 "PUT /v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5/file HTTP/1.1" 409 79
RESP: [409] Connection: close Content-Length: 79 Content-Type: text/plain; charset=UTF-8 x-openstack-request-id: req-bf01af04-aa24-4ba6-bf93-7f909f442f37
RESP BODY: Omitted, Content-Type is set to text/plain; charset=UTF-8. Only application/json responses have their bodies logged.
PUT call to image for https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5/file used request id req-bf01af04-aa24-4ba6-bf93-7f909f442f37
Deleting failed upload of image ubuntu-server-20.04-focal
REQ: curl -g -i --insecure -X DELETE https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5 -H "User-Agent: openstacksdk/0.59.0 keystoneauth1/4.4.0 python-requests/2.26.0 CPython/3.6.8" -H "X-Auth-Token: {SHA256}7413f5abcbdc45993c0b64c560665f198387e1d3a4fa58549b55ba12dc25d03a"
Resetting dropped connection: xxx.xxx.xxx.xxx
https://xxx.xxx.xxx.xxx:9292 "DELETE /v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5 HTTP/1.1" 204 0
RESP: [204] Connection: close Content-Length: 0 Content-Type: text/html; charset=UTF-8 x-openstack-request-id: req-631ee055-77ce-4b6a-8374-d53e3ab0e984
RESP BODY: Omitted, Content-Type is set to text/html; charset=UTF-8. Only application/json responses have their bodies logged.
DELETE call to image for https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5 used request id req-631ee055-77ce-4b6a-8374-d53e3ab0e984
Image creation failed
Traceback (most recent call last):
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/image/v2/_proxy.py", line 235, in _upload_image
**kwargs)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/image/v2/_proxy.py", line 293, in _upload_image_put
exceptions.raise_from_response(response)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/exceptions.py", line 238, in raise_from_response
http_status=http_status, request_id=request_id
openstack.exceptions.ConflictException: ConflictException: 409: Client Error for url: https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5/file, Conflict
ConflictException: 409: Client Error for url: https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5/file, Conflict
Traceback (most recent call last):
File "/home/rkruck/.local/lib/python3.6/site-packages/cliff/app.py", line 407, in run_subcommand
result = cmd.run(parsed_args)
File "/home/rkruck/.local/lib/python3.6/site-packages/osc_lib/command/command.py", line 39, in run
return super(Command, self).run(parsed_args)
File "/home/rkruck/.local/lib/python3.6/site-packages/cliff/display.py", line 115, in run
column_names, data = self.take_action(parsed_args)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstackclient/image/v2/image.py", line 502, in take_action
image = image_client.create_image(**kwargs)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/image/_base_proxy.py", line 213, in create_image
**image_kwargs)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/image/v2/_proxy.py", line 235, in _upload_image
**kwargs)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/image/v2/_proxy.py", line 293, in _upload_image_put
exceptions.raise_from_response(response)
File "/home/rkruck/.local/lib/python3.6/site-packages/openstack/exceptions.py", line 238, in raise_from_response
http_status=http_status, request_id=request_id
openstack.exceptions.ConflictException: ConflictException: 409: Client Error for url: https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5/file, Conflict
clean_up CreateImage: ConflictException: 409: Client Error for url: https://xxx.xxx.xxx.xxx:9292/v2/images/395b1140-c0e3-48a9-872e-8b535cb237e5/file, Conflict
END return value: 1
Happy to provide anything else as I am stuck trying to get past this. If I log into Horizon I do see an attempt to save the image, so I don't feel it is an authentication/access issue.

Related

parse error: Invalid numeric literal at line 1, column 7

I am trying to call an API using Curl. The request was timing out after 60 secs due to TCP Timeout. I added "-H "Connection: keep-alive" -H "Keep-Alive: timeout=90, max=100" to the existing code.
curl -s -X POST -u $regressionTestAuthToken -H Content-Type: application/json -H Accept: application/json -H "Connection: keep-alive" -H "Keep-Alive: timeout=90, max=100" $URL -d#"${WORKSPACE}"/tmp.json > "${WORKSPACE}"/out.json
After adding the Connection Keep-Alive, I am getting a parse error
parse error: Invalid numeric literal at line 1, column 7
Can someone help me to triage this issue?

Keycloak, adding realm role to user via admin api on curl

Using keycloak 6.0.1
I have created the realm role and the user. I have the user uuid and the role uuid.
If I run
curl -v -X POST -w "\n" http://localhost:8080/auth/admin/realms/SpringBootKeycloak/users/$USER_ID/role-mappings/realm -H "Content-Type: application/json" -H "Authorization: bearer $TOKEN" --data '[{"id":$ROLE_ID,"name":"user"}]'
Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /auth/admin/realms/SpringBootKeycloak/users/fe38bcb5-258b-44e4-a056-cf8c1a29b99f/role-mappings/realm HTTP/1.1
> Host: localhost:8080
> User-Agent: curl/7.58.0
> Accept: */*
> Content-Type: application/json
> Authorization: bearer very long string
> Content-Length: 31
>
* upload completely sent off: 31 out of 31 bytes
< HTTP/1.1 500 Internal Server Error
< Connection: keep-alive
< Content-Length: 0
< Date: Fri, 13 Sep 2019 08:53:14 GMT
<
* Connection #0 to host localhost left intact
I get a server error and a log entry of
10:00:55,903 ERROR [org.keycloak.services.error.KeycloakErrorHandler] (default task-10) Uncaught server error: com.fasterxml.jackson.databind.JsonMappingException: Unrecognized token '$ROLE_ID': was expecting ('true', 'false' or 'null')
at [Source: (io.undertow.servlet.spec.ServletInputStreamImpl); line: 1, column: 3] (through reference chain: java.util.ArrayList[0])
Alternatively if I run curl with data of
--data '[{"id":"$ROLE_ID","name":"user"}]'
then get return of 404 not found.
If I set data to be hardcoded then it works
--data '[{"id":"9b6371f2-646d-4927-b3b6-6e208935517e","name":"user"}]'
but get return of 204 No Content which is success. And the role is added.
Further investigation -
--data '[{"id":"'$ROLE_ID'","name":"user"}]'
gives a 204 status and the role is added to the user.
So get there eventually.
That is a problem with variable substitution:
$ export ROLE_ID=9b6371f2-646d-4927-b3b6-6e208935517e
$ echo '[{"id":"'$ROLE_ID'","name":"user"}]'
[{"id":"9b6371f2-646d-4927-b3b6-6e208935517e","name":"user"}]
$ echo '[{"id":$ROLE_ID,"name":"user"}]'
[{"id":$ROLE_ID,"name":"user"}]
$ echo '[{"id":"$ROLE_ID","name":"user"}]'
[{"id":"$ROLE_ID","name":"user"}]

Cannot extract data from an HTTP PUT request in Ruby

I am trying to implement a simple server in Ruby, but somehow I can't get the data from a put request.
curl request that I am making:
curl -v -X PUT localhost:2016/api/kill -d {"connId" : 1}
The server seems to be reading the request alright.
The code:
while line = socket.gets
puts line.chomp
request << line.chomp
break if line =~ /^\s*$/
end
produces the output:
PUT /api/kill HTTP/1.1
User-Agent: curl/7.35.0
Host: localhost:2016
Accept: */*
Content-Length: 7
Content-Type: application/x-www-form-urlencoded
But I don't see the data anywhere?
Am I supposed to see it?
Is something wrong with the curl request?
You need single quotes around the body.
curl -v -X PUT localhost:2016/api/kill -d '{"connId" : 1}'

Firefox web push "Invalid URL endpoint"

I try to send webpush to firefox
curl -i -X PUT https://updates.push.services.mozilla.com/push/gAAAAABW5EzHyop8VZSH2jm9LJ7W8ybH3ISlbZHDGnd4RwW7h2Jb0IGTuSsP2BCoBxl0kJp-kXXL164xNzhxkTEztP1-IqVf9040VOEuy_htb1nnp-24W-RGgWgjtGK1kZYAb1k3xmAS
HTTP/1.1 400 Bad Request
Access-Control-Allow-Headers: content-encoding,encryption,crypto-key,ttl,encryption-key,content-type,authorization
Access-Control-Allow-Methods: POST,PUT
Access-Control-Allow-Origin: *
Access-Control-Expose-Headers: location,www-authenticate
Content-Type: application/json
Date: Tue, 15 Mar 2016 13:04:44 GMT
Server: cyclone/1.1
Content-Length: 51
Connection: keep-alive
{"errno": 102, "code": 400, "error": "Bad Request"}
Does it mean that I have invalid registration id stored in my database and I should remove it?
The endpoint URL doesn't seem valid, it's usually something like https://updates.push.services.mozilla.com/push/v1/SOME_LONG_ID (note the v1 that your URL doesn't contain).
Indeed, this works:
curl -i -X PUT https://updates.push.services.mozilla.com/push/v1/gAAAAABW5EzHyop8VZSH2jm9LJ7W8ybH3ISlbZHDGnd4RwW7h2Jb0IGTuSsP2BCoBxl0kJp-kXXL164xNzhxkTEztP1-IqVf9040VOEuy_htb1nnp-24W-RGgWgjtGK1kZYAb1k3xmAS
Note that you might want to add the TTL header, otherwise your request might fail (you just need -H "TTL: 60"): https://blog.mozilla.org/services/2016/02/20/webpushs-new-requirement-ttl-header/.

Error with DataStax Commuity on Amazon EC2

I got this Error if i want to Setup the Datastax Cassandra Cluster (Community Edition), i have used this:
http://www.datastax.com/docs/1.2/install/install_ami
[EXEC] 06/05/13-10:52:05 sudo rm -rf /etc/motd
[EXEC] 06/05/13-10:52:05 sudo touch /etc/motd
[INFO] Started with user data set to:
[INFO] --clustername myDSCcluster --totalnodes 3 --version community
[INFO] Using instance type: m1.large
[ERROR] Exception seen in ds1_launcher.py:
Traceback (most recent call last):
File "/home/ubuntu/datastax_ami/ds1_launcher.py", line 31, in initial_configurations
ds2_configure.run()
File "/home/ubuntu/datastax_ami/ds2_configure.py", line 932, in run
File "/home/ubuntu/datastax_ami/ds2_configure.py", line 125, in get_ec2_data
File "/usr/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 406, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 444, in error
return self._call_chain(*args)
File "/usr/lib/python2.7/urllib2.py", line 378, in _call_chain
result = func(*args)
File "/usr/lib/python2.7/urllib2.py", line 527, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: Not Found
It seems as though you may have attempted to launch the cluster within a VPC, which isn't supported.
I did, however, notice that we don't specifically mention that VPC's aren't supported. I'll make sure we get that fixed.

Resources