Skip to content
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

Databases endpoint broken in 3.3.1 #473

Closed
groened opened this issue Sep 17, 2024 · 3 comments
Closed

Databases endpoint broken in 3.3.1 #473

groened opened this issue Sep 17, 2024 · 3 comments

Comments

@groened
Copy link

groened commented Sep 17, 2024

When attempting to use the Databases.php getAll() function, supplying a valid UUID, it produces an error:

TypeError: Cannot assign null to property AcquiaCloudApi\Response\DatabaseResponse::$user_name of type string in AcquiaCloudApi\Response\DatabaseResponse->__construct() (line 23 of /var/www/html/vendor/typhonius/acquia-php-sdk-v2/src/Response/DatabaseResponse.php).

@typhonius
Copy link
Owner

typhonius commented Sep 23, 2024

Hi I tried to replicate this on the latest stable (3.3.1) but wasn't able to. How are you calling the library - any additional context would be great thanks

@groened
Copy link
Author

groened commented Oct 4, 2024

I am not doing anything interesting- just calling getDatabases($environment_id) function on AcquiaCloudApi\Endpoints\Databases class with a valid environment ID.

The response I get back from Acquia for each database is a class with ID, name, db_host, flags, environment, and name. However, there is no $user_name.

getDatabases, attempts to create a new AcquiaCloudApi\Response\DatabasesResponse, which attempts to create a new AcquiaCloudApi\Response\DatabaseResponse. The constructor of DatabaseResponse attempts to set the $user_name: $this->user_name = $database->user_name; Because my response has no username, and $this->user_name is typed as a string, the exception is thrown.

I see the comment about having the permission, "View database connection details (username, password, or hostname)", but I have double and triple-checked, and I definitely have this permission, and am using my api key/secret.

@danepowell
Copy link
Collaborator

Please open an Acquia support request with details about your application and user account. This has always been a result of lacking the permission you mention, but possibly there are other permissions involved or problems with your application.

I'm going to revert the commit that caused the typeerrors, but note that this won't fix the issue. Downstream clients (i.e. ACLI) will need to verify the connection details before attempting to use them.

#477

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants