3scale / 3scale_toolbox

3scale toolbox
Apache License 2.0
37 stars 73 forks source link

cannot duplicate a service #31

Closed lucamaf closed 6 years ago

lucamaf commented 6 years ago

when trying to make a copy of the service on the same instance I receive the following error

/usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- json (LoadError)
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/luferrar/.gem/ruby/2.4.0/gems/3scale-api-0.1.5/lib/3scale/api/http_client.rb:1:in `<top (required)>'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /usr/share/rubygems/rubygems/core_ext/kernel_require.rb:55:in `require'
    from /home/luferrar/.gem/ruby/2.4.0/gems/3scale-api-0.1.5/lib/3scale/api.rb:9:in `new'
    from /home/luferrar/.gem/ruby/2.4.0/gems/3scale_toolbox-0.3.0/exe/3scale-copy:77:in `<main>'

the command I ran was 3scale copy service 2555417752749 --source=https://[provider-key]@psd2-env-admin.3scale.net --destination=https://[provider-key]@psd2-env-admin.3scale.net

ruby version is 2.4.2p198

mikz commented 6 years ago

Just installed ruby 2.4.2 by ruby-install:

$ ruby-install ruby-2.4.2
$ chruby 2.4.2
$ ruby -rjson -eJSON && echo "works"
works
$ gem list                                                                                                                                                                                                                    ruby-2.4.2

*** LOCAL GEMS ***

bigdecimal (default: 1.3.0)
did_you_mean (1.1.0)
io-console (default: 0.4.6)
json (default: 2.0.4)
minitest (5.10.1)
net-telnet (0.1.1)
openssl (default: 2.0.5)
power_assert (0.4.1)
psych (default: 2.2.2)
rake (12.0.0)
rdoc (default: 5.0.0)
test-unit (3.2.3)
xmlrpc (0.2.1)

Looks like you have broken ruby installation. JSON there is there always and by default.

lucamaf commented 6 years ago

the command now works, just some comments on it: the base path, integration mode and API authentication are not copied to the new service. Ideally the tool would be used to have a full duplicate and then just modify the staging and production endpoints.

mikz commented 6 years ago

@lucamaf feel free to open new issue/ PR for those improvements. Closing this one.