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

Error when importing app file - adding documentation example of expected inputs and mandatory arguments #82

Closed
carlosmscabral opened this issue Sep 1, 2022 · 1 comment

Comments

@carlosmscabral
Copy link

When issuing the following command

apigeecli apps import -o APIGEE_ORG -d developers.json -f apps.json

I receive the following generic error:

_panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1421a9b]

goroutine 11 [running]:
github.com/apigee/apigeecli/client/apps.createAsyncApp({{0xc000023440, 0x18}, {0xc000216148, 0x8}, 0xc00000c948, 0x0, {0x0, 0x0}, {0xc00015ae00, 0x1, ...}, ...}, ...)
github.com/apigee/apigeecli/client/apps/apps.go:401 +0xbb
created by github.com/apigee/apigeecli/client/apps.batchImport
github.com/apigee/apigeecli/client/apps/apps.go:388 +0x21f_

The Developers where previously and successfully created from the developers.json file:

{
"developer": [
{
"email": "[email protected]",
"firstName": "manuel",
"lastName": "dapadaria",
"userName": "manueldapadaria"
},
{
"email": "[email protected]",
"firstName": "faria",
"lastName": "limer",
"userName": "farialimer"
}
]
}

The apps.json file I am using is:

[{
"attributes": [
{
"name": "DisplayName",
"value": "AppCorretorFarialLimer"
}
],
"credentials": [
{
"apiProducts": [
{
"apiproduct": "RiskPremiumProduct",
"status": "approved"
}
],
"consumerKey": "Sp8sRIKof7a0DI7xkSSlYTvPvu3KctqGA4EhF5SVU9yAeaz3",
"consumerSecret": "4k1rlKqiaZzBarvdrmAHotyHPkKlHXwilszRGzMrAxqzLYNI1gSAYY0HD4PfUTaS",
"expiresAt": "-1",
"status": "approved"
}
],
"name": "AppCorretorFarialLimer",
"status": "approved"
}
,{
"attributes": [
{
"name": "DisplayName",
"value": "AppCorretorManuelPadaria"
}
],
"credentials": [
{
"apiProducts": [
{
"apiproduct": "RiskStandardProduct",
"status": "approved"
}
],
"consumerKey": "qAN1h1IK8m9T5mAI1d9JtejE3GCLMNvQoHfYoffN9pPj8K9o",
"consumerSecret": "G4lG6gl9QJxZqdt3w2luYwOm7x84cGHb5Z4cyirhSzgpYOgE5bI3dObjx2hnkMJD",
"expiresAt": "-1",
"issuedAt": "1660910829128",
"status": "approved"
}
],
"name": "AppCorretorManuelPadaria",
"status": "approved"
}
]

Since the error is generic (SIGSEV), ideally we should enhance the error message to show what is missing or document with example files what should be expected.

@srinandan
Copy link
Collaborator

I see two problems.

  1. The developers.json file is missing the developer id.
  2. The apps.json file is also missing the developer id.

Here is a sample of developers.json

{
  "developer": [
    {
      "email": "[email protected]",
      "firstName": "first",
      "lastName": "last",
      "userName": "fl",
      "apps": [
        "foo"
      ],
      "developerId": "dfba9f67-6b05-4f47-9261-c537a5ead048",
      "organizationName": "my-org",
      "status": "active",
      "createdAt": "1642879828144",
      "lastModifiedAt": "1642879828144"
    }
  ]
}

Note the difference in the file

I notice the same problem in apps too.

srinandan added a commit that referenced this issue Sep 2, 2022
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

2 participants