Closed dinhanhthi closed 2 years ago
Hi @dinhanhthi,
I could not successfully replicate your issue. For reference, I used this code (slightly modified from here):
function main(projectId, displayName) {
// [START cloudresourcemanager_v3_generated_Projects_CreateProject_async]
// Imports the Resourcemanager library
const {ProjectsClient} = require('@google-cloud/resource-manager').v3;
// Instantiates a client
const resourcemanagerClient = new ProjectsClient();
async function callCreateProject() {
// Construct request
const request = {
project: {
projectId,
displayName
},
};
console.log(request)
// Run request
const [operation] = await resourcemanagerClient.createProject(request);
const [response] = await operation.promise();
console.log(response);
}
callCreateProject();
// [END cloudresourcemanager_v3_generated_Projects_CreateProject_async]
}
process.on('unhandledRejection', err => {
console.error(err.message);
process.exitCode = 1;
});
main(...process.argv.slice(2));
Some troubleshooting ideas I have:
1) Can you post your credentials.js file (with all values redacted?) I authenticated with application default credentials, but there are many ways to authenticate; I'm just not familiar with the way in which you are authenticating.
2) Can you attempt to create a project outside of the parent organization? You may be attempting to create a project in an organization that has some restrictions, and it may just be giving you a bad error message.
Closing due to inactivity, please feel free to reopen if it continues to be a problem.
Hi everyone,
I've a problem when using
ProjectsClient.createProject()
to create a new project. I've used the example codes provided in the reference,However, there is alway an error on the second command,
According to this guide, it's a long-running operation, I know that and I've tried with
ProjectsClient. checkCreateProjectProgress()
(ref). However, the same problem occurs,Moreover, the project is well created on the cloud but the problem is I don't know when it's finished to continue my task.
Environment details
@google-cloud/resource-manager
version: 3.0.0Steps to reproduce
Create a file
createProject.js
with the following content,Then call,