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

operable:unique fails when value is empty #1391

Open
splashx opened this issue Jun 7, 2017 · 2 comments
Open

operable:unique fails when value is empty #1391

splashx opened this issue Jun 7, 2017 · 2 comments
Labels

Comments

@splashx
Copy link

splashx commented Jun 7, 2017

dio: !ec2:instance-list | raw | echo $security_groups

cog APP:

[]
[]
[]
[{"group_name":"launch-wizard-1","group_id":"sg-6cb8d309"}]
[]

dio: !ec2:instance-list | echo $security_groups | unique | raw

cog APP:

It appears that the `operable:unique` command crashed while executing, with the following error:

`%CaseClauseError{term: ""}`

Here is the stacktrace at the point where the crash occurred. This information can help the authors of the command determine the ultimate cause for the crash.

```  [file: 'lib/cog/commands/unique.ex', line: 25]},
 {Cog.Command.GenCommand, :process_message, 3,
  [file: 'lib/cog/command/gen_command.ex', line: 188]},
 {Cog.Command.GenCommand, :handle_info, 2,
  [file: 'lib/cog/command/gen_command.ex', line: 163]},
 {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]},
 {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 667]},
 {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]``````
@nmohoric
Copy link
Member

Looks like a bug in how steps are named, at some point it was "first", nil, "last" but now it seems the nil could be "".

I have a quick fix for this command but would like to look into what changed to cause this and maybe fix it there instead.

@splashx
Copy link
Author

splashx commented Oct 16, 2017

I've just bumped into a unique problem again.
Funny thing someone has not reported it because the seed built-in command uses unique as an example and that example will crash sonia:

dio [11:29 PM] 
seed ‘[{“a”: 1}, {“a”: 3}, {“a”: 1}]’ | unique

bot APP [11:29 PM] 
It appears that the `operable:unique` command crashed while executing, with the following error:

`%CaseClauseError{term: ""}`

Here is the stacktrace at the point where the crash occurred. This information can help the authors of the command determine the ultimate cause for the crash.

```  [file: 'lib/cog/commands/unique.ex', line: 25]},
 {Cog.Command.GenCommand, :process_message, 3,
  [file: 'lib/cog/command/gen_command.ex', line: 188]},
 {Cog.Command.GenCommand, :handle_info, 2,
  [file: 'lib/cog/command/gen_command.ex', line: 163]},
 {:gen_server, :try_dispatch, 4, [file: 'gen_server.erl', line: 601]},
 {:gen_server, :handle_msg, 5, [file: 'gen_server.erl', line: 667]},
 {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]``````

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants