You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Question, potentially a bug] How to debug requests when creating a server #403
Hi there, I'd appreciate some assistance on the following error that's produced by the SDK:
[09-Feb-2024 07:13:20 UTC] HTTP Error
~~~~~~~~~~
The remote server returned a "400 Bad Request" error for the following transaction:
Request
~~~~~~~
POST /compute/v2.1/servers HTTP/1.1
User-Agent: GuzzleHttp/7
Content-Type: application/json
Host: something
Response
~~~~~~~~
HTTP/1.1 400 Bad Request
Date: Fri, 09 Feb 2024 07:13:20 GMT
Server: Apache/2.4.52 (Ubuntu)
OpenStack-API-Version: compute 2.1
X-OpenStack-Nova-API-Version: 2.1
Vary: OpenStack-API-Version,X-OpenStack-Nova-API-Version
Content-Type: application/json; charset=UTF-8
Content-Length: 137
x-openstack-request-id: something
x-compute-request-id: something else
Connection: close
Further information
~~~~~~~~~~~~~~~~~~~
Please ensure that your input values are valid and well-formed. Visit http://docs.php-opencloud.com/en/latest/http-codes for more information about debugging HTTP status codes, or file a support issue on https://github.com/php-opencloud/openstack/issues.
This error is produced with code as follows:
// Creates a new user on the OpenStack server and then establishes a new OpenStack connection instance using the new user's credentials.$OpenStack = $this->authenticateAsClient();
// Now create a new network for the server to be attached to$network = $OpenStack->networkingV2()->createNetwork([
'name' => "Some name",
'adminStateUp' => true,
]);
// Finally create the server$server = $OpenStack->computeV2()->createServer([
'name' => "Some name",
'imageId' => "The image ID",
'flavorId' => "The flavor ID",
'networks' => [
['uuid' => $network->id]
],
]);
I am fairly new to OpenStack and I am working on a project with it, so I apologize if there's something I am blaitantly doing wrong here, but the logged message isn't particularly clear on what the problem is & searching "debug" on the docs returns no results.
Activity
k0ka commentedon Feb 9, 2024
Hello,
Openstackobject. Like we do for debugging integration tests:k0ka commentedon Feb 9, 2024
What php memory limit do you have?
It should output the full request/response body in the error by default:
openstack/src/Common/Error/Builder.php
Line 99 in d823be3
fix #403
enchance error builder: output body only for json, limit body to 5 Kb (…
k0ka commentedon Feb 10, 2024
released in https://github.com/php-opencloud/openstack/releases/tag/v3.9.0
Upstream sync (#12)
Feature/ck 2099 merge upstream (#13)