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
This issue has already been reported on #1928, however, it was closed due to no activity. This issue has pull_request #1930 so I recreated the issue here.
When running terraformer import google without the regions flag, the following error appears in the log:
2024/09/29 03:03:13 googleapi: Error 400: Invalid value for field 'region': 'global'. Unknown region., invalid
Although this error doesn't stop the command from completing successfully, it's misleading and could cause confusion for users.
Cause:
The issue arises because, if the regions flag is not set, global is used as the default value for the region. However, global is not a valid region for this API call:
This call triggers the following gRPC API request:
GET https://compute.googleapis.com/compute/v1/projects/{project}/regions/{region}
Since global is not a recognized region, the API responds with an error.
Proposed Solution:
To fix this, the code should handle the case when the region is set to global by skipping the API call. This could be implemented by adding a conditional check in the getRegion function:
By making this change, the error message will no longer appear when global is used as the default region, and it will prevent unnecessary API requests.
Additional Information:
This issue only occurs when the regions flag is not provided.
The error message does not affect the overall functionality of the command.
The text was updated successfully, but these errors were encountered:
Note
This issue has already been reported on #1928, however, it was closed due to no activity. This issue has pull_request #1930 so I recreated the issue here.
When running
terraformer import google
without theregions
flag, the following error appears in the log:Although this error doesn't stop the command from completing successfully, it's misleading and could cause confusion for users.
Cause:
The issue arises because, if the
regions
flag is not set,global
is used as the default value for the region. However,global
is not a valid region for this API call:This call triggers the following gRPC API request:
Since
global
is not a recognized region, the API responds with an error.Proposed Solution:
To fix this, the code should handle the case when the region is set to
global
by skipping the API call. This could be implemented by adding a conditional check in thegetRegion
function:By making this change, the error message will no longer appear when
global
is used as the default region, and it will prevent unnecessary API requests.Additional Information:
regions
flag is not provided.The text was updated successfully, but these errors were encountered: