Skip to content
This repository has been archived by the owner on Oct 31, 2022. It is now read-only.

Unable to Deploy - An error occured while performing the operation #16

Closed
tdavis13 opened this issue Aug 3, 2020 · 9 comments
Closed
Labels
bug Something isn't working

Comments

@tdavis13
Copy link

tdavis13 commented Aug 3, 2020

I am running into an error trying to run the serve command and unable to get past this. I am not sure where the issue even sits.

nr1-command-center>nr1 nerdpack:serve --verbose
init version: @oclif/command@1.5.19 argv: [ '--verbose', [length]: 1 ]
init version: @oclif/command@1.5.19 argv: [ '--verbose', [length]: 1 ]
Found and loaded 2 nr1.json files on msp-alerts (60c98924-44fd-458f-bbf6-b96485cede4c) Nerdpack.
Schema file is 8 min old

Nerdpack:
√ msp-alerts (60c98924-44fd-458f-bbf6-b96485cede4c) nr1.json

Launchers:
√ nr1-command-center-launcher launchers\nr1-command-center-launcher\nr1.json

Nerdlets:
√ nr1-command-center-nerdlet nerdlets\nr1-command-center-nerdlet\nr1.json

Using profile XXXXX_NonProd_US
There is no certificate created yet.
Request: GET https://ca.service.newrelic.com/user/certificate
Data: undefined
Headers: {
'API-Key': 'XXXXXXX'
}

x Error: An error ocurred while performing the operation

{ origin: 'service' }

@tdavis13 tdavis13 added the bug Something isn't working label Aug 3, 2020
@khpeet
Copy link
Collaborator

khpeet commented Aug 3, 2020

Hello @tdavis13 ! Can you please provide the output of the following commands?

nr1 --version
nr1 profiles:list

It looks like there is an issue generating a cert for your default profile - which may not be set. Assuming the profile(account) that the nerdpack is being served to is not your default profile, you could try running nr1 nerdpack:serve with the --profile flag like this:

nr1 nerdpack:serve --profile=XXXXX_NonProd_US

@tdavis13
Copy link
Author

tdavis13 commented Aug 3, 2020

nr1-command-center>nr1 --version
@datanerd/nr1/1.22.2 win32-x64 node-v10.16.3

nr1-command-center>nr1 profiles:list
Name Region API key


XXXXX_NonProd_US (default) us

@khpeet
Copy link
Collaborator

khpeet commented Aug 3, 2020

@tdavis13 - are you able to successfully curl https://ca.service.newrelic.com/user/certificate ? You could also try to remove your certs directory located under .newrelic and try to run nr1 nerdpack:serve again.

Another common issue (especially on Windows) is file/directory permissions. I would make sure your user (or whatever user installed nr1 CLI) has read/write access to the .newrelic directory.

@tdavis13
Copy link
Author

tdavis13 commented Aug 3, 2020 via email

@tdavis13
Copy link
Author

tdavis13 commented Aug 3, 2020

So, I wiped out the nr1-command-center directory I had and tried in a new location. Caught an error I may have missed before. On the download/unpack of the repository, I get an error with the uuid regeneration. Running just that command, I get:

nr1-command-center>nr1 nerdpack:uuid --generate --force
x Error: 401 - Your API key is missing or is invalid

i You can run this command with "--verbose" for more info.

nr1-command-center>nr1 nerdpack:uuid --generate --force --verbose
init version: @oclif/command@1.5.19 argv: [ '--generate', '--force', '--verbose', [length]: 3 ]
Using profile XXXXX_NonProd_US
Request: POST https://artifact-registry.service.newrelic.com/graphql
Data: mutation {
generatePackageUuid
}
Headers: {
'API-Key': 'XXXXXXX',
'Content-Type': 'application/graphql'
}

x Error: 401 - Your API key is missing or is invalid

{ origin: 'service-gateway' }

I had dropped and recreated my only profile.

@khpeet
Copy link
Collaborator

khpeet commented Aug 3, 2020

Yeah the .newrelic directory should be somewhere else- I spun up a windows machine and for me after going through the CLI install steps 1-4 found by clicking on the "New Relic One command line interface (CLI)" link located on this page: https://developer.newrelic.com/build-apps/set-up-dev-env ...

The .newrelic directory was located at C:\Users\<myUser>\.newrelic

@tdavis13
Copy link
Author

tdavis13 commented Aug 3, 2020

Looks like I just had to dig out the 'right' API key. Now, I get a Syntax Error. But, this may be a different issues now.

[./nerdlets/nr1-command-center-nerdlet/alarms.js] 2.58 KiB {b7d5d057-55b3-4de8-bfe8-d7dd07d6fdbb--nr1-command-center-nerdlet} [built] [failed] [1 error]
[./nerdlets/nr1-command-center-nerdlet/index.js] 2.83 KiB {b7d5d057-55b3-4de8-bfe8-d7dd07d6fdbb--nr1-command-center-nerdlet} [built]
[nr1] external "__NR1_EXTERNAL_LIB__" 42 bytes {b7d5d057-55b3-4de8-bfe8-d7dd07d6fdbb--nr1-command-center-nerdlet} [built]
[react] external "React" 42 bytes {b7d5d057-55b3-4de8-bfe8-d7dd07d6fdbb--nr1-command-center-nerdlet} [built]

ERROR in ./nerdlets/nr1-command-center-nerdlet/alarms.js
Module build failed (from C:/Users/td013244/AppData/Local/newrelic-cli/client/1.22.2/node_modules/babel-loader/lib/index.js):
SyntaxError: c:\Users\td013244\Desktop\nr1-command-center\nerdlets\nr1-command-center-nerdlet\alarms.js: Unexpected token, expected "}" (41:12)

  39 |
  40 |     this.schema = {
> 41 |       "type": "object",
     |             ^
  42 |       "properties": {
  43 |         "accounts": {
  44 |           "type": "array",
    at Object._raise (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:742:17)
    at Object.raiseWithData (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:735:17)
    at Object.raise (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:729:17)
    at Object.unexpected (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:8757:16)
    at Object.expect (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:8743:28)
    at Object.jsxParseExpressionContainer (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:4468:10)
    at Object.jsxParseElementAt (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:4559:36)
    at Object.jsxParseElement (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:4602:17)
    at Object.parseExprAtom (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:4609:19)
    at Object.parseExprSubscripts (C:\Users\td013244\AppData\Local\newrelic-cli\client\1.22.2\node_modules\@babel\parser\lib\index.js:9602:23)
 @ ./nerdlets/nr1-command-center-nerdlet/index.js 14:0-30 49:48-54

Child
Hash: c2df752adee82316e500
Time: 3690ms
Built at: 08/03/2020 6:30:59 PM
Asset Size Chunks Chunk Names

@khpeet
Copy link
Collaborator

khpeet commented Aug 3, 2020

glad you solved it! Yes that issue is solved by filling this pre-req:

Configured accountId within alarms.js (this.accountId = <your_account_id>)

Basically put the accountId of whatever account you are deploying it to.

@tdavis13
Copy link
Author

tdavis13 commented Aug 3, 2020

This can be closed now. Finally got it all working. Now, it is humming. Go figure out how to make it sing now.

@tdavis13 tdavis13 closed this as completed Aug 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants