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

Crashes on startup with saphanaacademy-mta generator #698

Open
PhilipMugglestone opened this issue Feb 25, 2022 · 2 comments
Open

Crashes on startup with saphanaacademy-mta generator #698

PhilipMugglestone opened this issue Feb 25, 2022 · 2 comments

Comments

@PhilipMugglestone
Copy link

Hi,

On Windows in VS Code with the generator saphanaacademy-mta yeoman-ui crashes on startup.

Full log:
{
"label": "Application Wizard.AbstractWebviewPanel",
"level": "error",
"message": "Could not update method 'when' in 'dockerID' question in generator 'saphanaacademy-mta:app' - evaluateMethod() Cannot read property 'includes' of undefined",
"stack": "TypeError: evaluateMethod() Cannot read property 'includes' of undefined\n\tat module.exports.when (C:\Users\Administrator\AppData\Roaming\npm\node_modules\generator-saphanaacademy-mta\generators\app\index.js:35:47)\n\tat S. (c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:2033809)\n\tat Generator.next ()\n\tat c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:2028564\n\tat new Promise ()\n\tat n (c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:2028309)\n\tat S.evaluateMethod (c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:2033554)\n\tat s. (c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:1913344)\n\tat Generator.next ()\n\tat c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:1912006\n\tat new Promise ()\n\tat r (c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:1911751)\n\tat s.handleRequest (c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:1913099)\n\tat c:\Users\Administrator\.vscode\extensions\sapos.yeoman-ui-1.7.7\dist\extension.js:2:1914052\n\tat l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:64:1712)\n\tat S.$onMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:94:75455)\n\tat i._doInvokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:97:13801)\n\tat i._invokeHandler (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:97:13485)\n\tat i._receiveRequest (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:97:12147)\n\tat i._receiveOneMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:97:11024)\n\tat c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:97:8934\n\tat l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:64:1712)\n\tat s.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:72:19002)\n\tat c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:112:34390\n\tat l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:64:1712)\n\tat s.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:72:19002)\n\tat a._receiveMessage (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:72:23583)\n\tat c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:72:21117\n\tat l.fire (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:64:1712)\n\tat _.acceptChunk (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:72:15833)\n\tat c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:72:14963\n\tat Socket.A (c:\Program Files\Microsoft VS Code\resources\app\out\vs\workbench\services\extensions\node\extensionHostProcess.js:112:13838)\n\tat Socket.emit (events.js:315:20)\n\tat addChunk (internal/streams/readable.js:309:12)\n\tat readableAddChunk (internal/streams/readable.js:284:9)\n\tat Socket.Readable.push (internal/streams/readable.js:223:10)\n\tat Pipe.onStreamRead (internal/stream_base_commons.js:188:23)",
"time": "2022-02-25T09:35:19.031Z"
}
{
"label": "Application Wizard.AbstractWebviewPanel",
"level": "error",
"message": "saphanaacademy-mta:app generator failed - {"message":"Could not update method 'when' in 'dockerID' question in generator 'saphanaacademy-mta:app' - evaluateMethod() Cannot read property 'includes' of undefined","stack":"TypeError: evaluateMethod() Cannot read property 'includes' of undefined\n\tat module.exports.when (C:\\Users\\Administrator\\AppData\\Roaming\\npm\\node_modules\\generator-saphanaacademy-mta\\generators\\app\\index.js:35:47)\n\tat S. (c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:2033809)\n\tat Generator.next ()\n\tat c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:2028564\n\tat new Promise ()\n\tat n (c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:2028309)\n\tat S.evaluateMethod (c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:2033554)\n\tat s. (c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:1913344)\n\tat Generator.next ()\n\tat c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:1912006\n\tat new Promise ()\n\tat r (c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:1911751)\n\tat s.handleRequest (c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:1913099)\n\tat c:\\Users\\Administrator\\.vscode\\extensions\\sapos.yeoman-ui-1.7.7\\dist\\extension.js:2:1914052\n\tat l.fire (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:64:1712)\n\tat S.$onMessage (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:94:75455)\n\tat i._doInvokeHandler (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:97:13801)\n\tat i._invokeHandler (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:97:13485)\n\tat i._receiveRequest (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:97:12147)\n\tat i._receiveOneMessage (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:97:11024)\n\tat c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:97:8934\n\tat l.fire (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:64:1712)\n\tat s.fire (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:72:19002)\n\tat c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:112:34390\n\tat l.fire (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:64:1712)\n\tat s.fire (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:72:19002)\n\tat a._receiveMessage (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:72:23583)\n\tat c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:72:21117\n\tat l.fire (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:64:1712)\n\tat _.acceptChunk (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:72:15833)\n\tat c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:72:14963\n\tat Socket.A (c:\\Program Files\\Microsoft VS Code\\resources\\app\\out\\vs\\workbench\\services\\extensions\\node\\extensionHostProcess.js:112:13838)\n\tat Socket.emit (events.js:315:20)\n\tat addChunk (internal/streams/readable.js:309:12)\n\tat readableAddChunk (internal/streams/readable.js:284:9)\n\tat Socket.Readable.push (internal/streams/readable.js:223:10)\n\tat Pipe.onStreamRead (internal/stream_base_commons.js:188:23)"}",
"time": "2022-02-25T09:35:19.032Z"
}
{
"label": "Application Wizard",
"level": "error",
"message": "SAP Web Analytics tracker failed to track",
"statusCode": 400,
"time": "2022-02-25T09:35:19.162Z"
}

Can you take a look?

Thanks,
Philip

@slavik-lvovsky
Copy link
Member

Hi,

As you can see from the exception stack trace there is a problem in "dockerID" question, in "when" method.
There probably was a change in your generator and now it fails with this error "Cannot read property 'includes' of undefined".

Please try to debug this generator and check the "when" method.

This is the response object that you pass to the "when" method:
{"projectName":"app","newDir":true,"clusterDomain":"c-0000000.kyma.ondemand.com","namespace":"default","dockerID":"","apiS4HC":false,"apiGraph":false,"apiGraphURL":"https://.graph.sap/api","apiGraphId":"v1","apiGraphTokenURL":"https://.authentication..hana.ondemand.com","apiDest":false,"connectivity":false,"hana":false,"xsjs":false,"authentication":true,"authorization":true,"attributes":false,"apiGraphSameSubaccount":true,"ui":true,"cicd":false,"buildDeploy":false}

As you can see there is no "BTPRuntime" in it, that is why response.BTPRuntime.includes("Kyma") fails.

Regards,
Slavik.

@PhilipMugglestone
Copy link
Author

Hi Slavik,

I managed to workaround the crash issue by changing the generator to use name/value pairs for the choices on the list item BTPRuntime:

      {
        type: "list",
        name: "BTPRuntime",
        message: "Which runtime will you be deploying the project to?",
        choices: [{ name: "SAP BTP, Cloud Foundry runtime", value: "CF", checked: true }, { name: "SAP BTP, Kyma runtime", value: "Kyma" }],
        default: ["CF"]
      },
      {
        when: response => response.BTPRuntime === "Kyma",
        type: "input",
        name: "clusterDomain",
        message: "What is the cluster domain of your SAP BTP, Kyma runtime?",
        default: "c-0000000.kyma.ondemand.com"
      },

So yeoman-ui no longer crashes.

However I did notice that the default choice for BTPRuntime is not pre-selected by yeoman-ui. You have to explicitly select one of the choices!

Regards,
Philip

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