SUSE/machinery

/machinery-tool-1.18.0/lib/array.rb:187:in `[]': no implicit conversion of String into Integer (TypeError) after format upgrade from 5 to 7

Closed this issue · 15 comments

Trying to re-run machinery with a previsously inspected machine ask me to upgrade the format.
(Machine is 13.1) As this happened the second time I report the trace.

machinery show yoda
yoda: format version 5, needs to be upgraded. Try 'machinery upgrade-format yoda' to upgrade it to the current version.
bruno@qt-kt:~$ machinery upgrade-format yoda
Reading 'yoda' ... Successfully upgraded from version 5 to 7.
bruno@qt-kt:~$ machinery show yoda
bruno@qt-kt:~$ machinery inspect yoda
Inspecting yoda for os, packages, patterns, repositories, users, groups, services, config-files, changed-managed-files, unmanaged-files...

Note: There are filters being applied during inspection. (Use `--verbose` option to show the filters)


Inspecting os...
Machinery experienced an unexpected error. Please file a bug report at: https://github.com/SUSE/machinery/issues/new
/usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/array.rb:187:in `[]': no implicit conversion of String into Integer (TypeError)
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/array.rb:187:in `method_missing'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/filter.rb:151:in `block (2 levels) in apply!'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/filter.rb:149:in `each'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/filter.rb:149:in `block in apply!'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/filter.rb:143:in `each'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/filter.rb:143:in `apply!'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/inspect_task.rb:96:in `block in build_description'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/inspect_task.rb:79:in `each'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/inspect_task.rb:79:in `build_description'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/inspect_task.rb:21:in `inspect_system'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/lib/cli.rb:610:in `block (2 levels) in <class:Cli>'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/command_support.rb:126:in `call'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/command_support.rb:126:in `execute'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:296:in `block in call_command'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:309:in `call'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:309:in `call_command'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:83:in `run'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.18.0/bin/machinery:33:in `<top (required)>'
        from /usr/bin/machinery:23:in `load'
        from /usr/bin/machinery:23:in `<main>'

What kind of other information could help you?

I've added a diff between the 2 formats if that can help (I'm keeping the store under git)
for sanity I've just remove password and users

https://dav.ioda.net/index.php/s/kEnUR4xU4IVSbaM/download
1.6MB of git diff once uncompressed.

Hi @tigerfoot just by looking at the diff I cannot spot the issue. We are going to try to reproduce in order to follow up with you on this one. If we need anything else we'll let you know.

This could be related to #2021 which is already fixed in the development branch but there are some little differences.

We have another migration in the development branch but if you use git on your descriptions anyway it should not be a problem to try our development version to see if the issue is fixed there: https://ci.opensuse.org/view/Machinery/job/machinery-integration/4780/artifact/machinery/package/machinery-1.18.0.20160330T092242ZopenSUSELeap421gite869ff2-1.x86_64.rpm .

I'm using git only for the stored .machinery but wit tumbleweed it will not take so much time.
I will kept an old store format to verify the fix
Ty for the pointer.

À mer. mars 30 12:04:38 2016 GMT+0200, Tim Hardeck a écrit :

This could be related to #2021 which is already fixed in the development branch but there are some little differences.

We have another migration in the development branch but if you use git on your descriptions anyway it should not be a problem to try our development version to see if the issue is fixed there: https://ci.opensuse.org/view/Machinery/job/machinery-integration/4780/artifact/machinery/package/machinery-1.18.0.20160330T092242ZopenSUSELeap421gite869ff2-1.x86_64.rpm .


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#2041 (comment)

If the issue still appears with the development version, I would be interested in the old manifest.json (without the users of course).

We have released the new machinery version 1.19 which has the fix for the issue I have mentioned so you do not need to download a development version anymore.

On mardi, 5 avril 2016 02.10:55 h CEST Tim Hardeck wrote:

We have released the new machinery version 1.19 which has the fix for the issue I have mentioned so you do not need to download a development version anymore.

Ok that's cool, I will test it as soon it arrive in TW.

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch

openSUSE Member, fsfe fellowship
GPG KEY : D5C9B751C4653227
irc: tigerfoot

I have submitted machinery to Tumbleweed two days ago but if you always want the latest released machinery version you can also use our Repo: http://download.opensuse.org/repositories/systemsmanagement:/machinery/openSUSE_Tumbleweed/

Tested today on a format v5 upgraded to format v8

Inspecting yoda for os, packages, patterns, repositories, users, groups, services, changed-config-files, changed-managed-files, unmanaged-files...

Note: There are filters being applied during inspection. (Use `--verbose` option to show the filters)


Inspecting os...
Machinery experienced an unexpected error. Please file a bug report at: https://github.com/SUSE/machinery/issues/new
/usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/array.rb:187:in `[]': no implicit conversion of String into Integer (TypeError)
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/array.rb:187:in `method_missing'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/filter.rb:151:in `block (2 levels) in apply!'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/filter.rb:149:in `each'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/filter.rb:149:in `block in apply!'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/filter.rb:143:in `each'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/filter.rb:143:in `apply!'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/inspect_task.rb:96:in `block in build_description'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/inspect_task.rb:79:in `each'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/inspect_task.rb:79:in `build_description'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/inspect_task.rb:21:in `inspect_system'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/lib/cli.rb:617:in `block (2 levels) in <class:Cli>'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/command_support.rb:126:in `call'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/command_support.rb:126:in `execute'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:296:in `block in call_command'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:309:in `call'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:309:in `call_command'
        from /usr/lib64/ruby/gems/2.2.0/gems/gli-2.13.1/lib/gli/app_support.rb:83:in `run'
        from /usr/lib64/ruby/gems/2.2.0/gems/machinery-tool-1.19.0/bin/machinery:41:in `<top (required)>'
        from /usr/bin/machinery:23:in `load'
        from /usr/bin/machinery:23:in `<main>'

So the conversion is still somewhat buggy.
I'm cleaning the users lists and will post the 2 results

Many thanks for your help and the test files, I was able to reproduce and will work on a fix.

So we found the issue but it needs a migration to be fixed. If you like I can provide you with a bash command to fix this manually for now.

Tim no it's okay, once the fix will be published I will revert the .machinery/yoda (as I've them under git)
So I will able to replay the migration completely with the fix to confirm it is working.

@tigerfoot The new version 1.20 should be available in Tumbleweed now.

On lundi, 2 mai 2016 04.52:01 h CEST Tim Hardeck wrote:

@tigerfoot The new version 1.20 should be available in Tumbleweed now.

And the expected result is here : works like a charm now ;-)

Bruno Friedmann
Ioda-Net Sàrl www.ioda-net.ch
Bareos Partner
openSUSE Member, fsfe fellowship
GPG KEY : D5C9B751C4653227
irc: tigerfoot