alexa / ask-cli

Alexa Skills Kit Command Line Interface
https://developer.amazon.com/en-US/docs/alexa/smapi/ask-cli-intro.html
Apache License 2.0
167 stars 54 forks source link

ask-cli v2.15.0 fails to execute: ask smapi list-skills-for-vendor --profile default #303

Closed alexbigkid closed 4 years ago

alexbigkid commented 4 years ago

I'm submitting a...


[x] Regression (a behavior that used to work and stopped working in a new release)
[ ] Bug report  
[ ] Performance issue
[ ] Feature request
[ ] Documentation issue or request
[ ] Other... Please describe:

Expected Behavior

execution of the following command should be executed with returning skill-id without producing error: ask smapi list-skills-for-vendor --profile default

Current Behavior

execution of the following command: ask smapi list-skills-for-vendor --debug --profile default produces following error:


##[error]Bash exited with code '18'.
##[error]Bash wrote one or more lines to the standard error stream.
##[error]/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/model/abstract-config-file.js:92
        WRITE_METHOD_BY_FILE_TYPE[this.fileType](this.path, this.content);
                                                ^

This is the output of the command with debug:

/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/model/abstract-config-file.js:92 WRITE_METHOD_BY_FILE_TYPE[this.fileType](this.path, this.content); ^

TypeError: WRITE_METHOD_BY_FILE_TYPE[this.fileType] is not a function at AppConfig.write (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/model/abstract-config-file.js:92:49) at MetricClient._getMachineId (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/clients/metric-client/index.js:165:23) at new MetricClient (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/clients/metric-client/index.js:77:29) at Object. (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/utils/metrics.js:4:22) at Module._compile (internal/modules/cjs/loader.js:1076:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1097:10) at Module.load (internal/modules/cjs/loader.js:941:32) at Function.Module._load (internal/modules/cjs/loader.js:782:14) at Module.require (internal/modules/cjs/loader.js:965:19) at require (internal/modules/cjs/helpers.js:88:18) [GetAlexaSkillId] ERROR: no alexa skill found <- GetAlexaSkillId (18)

./002SetEnv.sh will write settings to the lambdaEnv-dev.json file This script (./002SetEnv.sh) must be called with 0 parameters.

./002SetEnv.sh --help - display this info EXIT_CODE = 18

[error]Bash exited with code '18'.

[error]Bash wrote one or more lines to the standard error stream.

[error]/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/model/abstract-config-file.js:92

    WRITE_METHOD_BY_FILE_TYPE[this.fileType](this.path, this.content);
                                            ^

TypeError: WRITE_METHOD_BY_FILE_TYPE[this.fileType] is not a function at AppConfig.write (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/model/abstract-config-file.js:92:49) at MetricClient._getMachineId (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/clients/metric-client/index.js:165:23) at new MetricClient (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/clients/metric-client/index.js:77:29) at Object. (/home/linuxbrew/.linuxbrew/Cellar/ask-cli/2.15.0/libexec/lib/node_modules/ask-cli/lib/utils/metrics.js:4:22) at Module._compile (internal/modules/cjs/loader.js:1076:30) at Object.Module._extensi

CLI Snapshot If applicable, add screenshots to help explain your problem.

Steps to Reproduce (for bugs)

Possible Solution

Your Environment and Context

kakhaUrigashvili commented 4 years ago

@alexbigkid I was not able to reproduce the issue. I have tried installing with brew and npm. Putting a breakpoint for the line that throws exception, this line of code does not even get executed by "ask smapi list-skills-for-vendor --profile default"

May be there is something with your file system set up?

Error code 18 - Invalid cross-device link

https://stackoverflow.com/questions/42392600/oserror-errno-18-invalid-cross-device-link

Are you running ask cli inside of a VM? Are you able to try running ask cli on different computer or using Docker just to see if it something with your system set up.

RonWang commented 4 years ago

@kakhaUrigashvili seems he's first time creating the $HOME/.ask folder and machineId is also first created so this logic is executed.

kakhaUrigashvili commented 4 years ago

@RonWang good point.

@alexbigkid if you modify your $HOME/.ask/cli_config file by adding machine id property, does the error disappear?

{
....
"machine_id": "2b13082e-e354-41d4-854a-ecf6a2b05de0"
}

machine id can be any random guid

If the error disappears the there is issue with write access of $HOME/.ask/cli_config file.

kakhaUrigashvili commented 4 years ago

closing due to inactivity.