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

lock file prevents install with --version of plugins that are needed by others #3152

Open
jsvd opened this Issue May 4, 2015 · 19 comments

Comments

Projects
None yet
7 participants
@jsvd
Member

jsvd commented May 4, 2015

In a release, the .lock file will contain the reference to a plugin's locked version even after being uninstalled IF other plugins depend on it. Example:

/tmp % tar -zxf logstash-2.0.0.dev.tar.gz
/tmp % cd logstash-2.0.0.dev
/tmp/logstash-2.0.0.dev % grep "logstash-codec-json .*0" Gemfile.jruby-1.9.lock
    logstash-codec-json (0.1.7)
/tmp/logstash-2.0.0.dev % bin/plugin uninstall logstash-codec-json
Uninstalling logstash-codec-json
/private/tmp/logstash-2.0.0.dev/vendor/local_gems/fccdd8d6/logstash-core-2.0.0.dev-java/lib/logstash/version.rb:3 warning: already initialized constant LOGSTASH_VERSION
/tmp/logstash-2.0.0.dev % grep "logstash-codec-json .*0" Gemfile.jruby-1.9.lock
    logstash-codec-json (0.1.7)
/tmp/logstash-2.0.0.dev % bin/plugin install --version="0.1.6" logstash-codec-json
Validating logstash-codec-json-0.1.6
Installing logstash-codec-json
Plugin not found, aborting
ERROR: Installation Aborted, message: You have requested:
  logstash-codec-json = 0.1.6

The bundle currently has logstash-codec-json locked at 0.1.7.
Try running `bundle update logstash-codec-json`
/tmp/logstash-2.0.0.dev %

@jsvd jsvd added the blocker label May 4, 2015

@jsvd jsvd changed the title from lock file prevents upgrade of plugins that are needed by others to lock file prevents install with --version of plugins that are needed by others May 4, 2015

@suyograo suyograo added the bug label May 5, 2015

@jsvd

This comment has been minimized.

Show comment
Hide comment
@jsvd

jsvd May 5, 2015

Member

Also a simple uninstall of a plugin that others depend on "fails":

% bin/plugin list tcp
logstash-input-tcp
logstash-output-tcp
% bin/plugin uninstall logstash-input-tcp
Uninstalling logstash-input-tcp
% bin/plugin list tcp
logstash-input-tcp
logstash-output-tcp
% bin/plugin uninstall logstash-input-tcp
ERROR: Uninstall Aborted, message: This plugin has not been previously installed, aborting
Member

jsvd commented May 5, 2015

Also a simple uninstall of a plugin that others depend on "fails":

% bin/plugin list tcp
logstash-input-tcp
logstash-output-tcp
% bin/plugin uninstall logstash-input-tcp
Uninstalling logstash-input-tcp
% bin/plugin list tcp
logstash-input-tcp
logstash-output-tcp
% bin/plugin uninstall logstash-input-tcp
ERROR: Uninstall Aborted, message: This plugin has not been previously installed, aborting
@purbon

This comment has been minimized.

Show comment
Hide comment
@purbon

purbon May 5, 2015

Contributor

I confirm this issue.

Contributor

purbon commented May 5, 2015

I confirm this issue.

@jsvd

This comment has been minimized.

Show comment
Hide comment
@jsvd

jsvd May 5, 2015

Member

The uninstalled plugin remains in vendor/bundle:

 % find . -name *logstash-input-tcp* 
./vendor/bundle/jruby/1.9/gems/logstash-input-tcp-0.1.5
./vendor/bundle/jruby/1.9/gems/logstash-input-tcp-0.1.5/logstash-input-tcp.gemspec
./vendor/bundle/jruby/1.9/specifications/logstash-input-tcp-0.1.5.gemspec

And while it's removed from Gemfile, it's still present in the .lock:

% grep "input-tcp" Gemfile*
Gemfile.jruby-1.9.lock:      logstash-input-tcp
Gemfile.jruby-1.9.lock:    logstash-input-tcp (0.1.5)
Member

jsvd commented May 5, 2015

The uninstalled plugin remains in vendor/bundle:

 % find . -name *logstash-input-tcp* 
./vendor/bundle/jruby/1.9/gems/logstash-input-tcp-0.1.5
./vendor/bundle/jruby/1.9/gems/logstash-input-tcp-0.1.5/logstash-input-tcp.gemspec
./vendor/bundle/jruby/1.9/specifications/logstash-input-tcp-0.1.5.gemspec

And while it's removed from Gemfile, it's still present in the .lock:

% grep "input-tcp" Gemfile*
Gemfile.jruby-1.9.lock:      logstash-input-tcp
Gemfile.jruby-1.9.lock:    logstash-input-tcp (0.1.5)
@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 5, 2015

Contributor

is that a regression from rc3

Contributor

colinsurprenant commented May 5, 2015

is that a regression from rc3

@jsvd

This comment has been minimized.

Show comment
Hide comment
@jsvd

jsvd May 5, 2015

Member

This is present in rc2 and rc3 as well, haven't tested rc1..

Member

jsvd commented May 5, 2015

This is present in rc2 and rc3 as well, haven't tested rc1..

@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 5, 2015

Contributor

ok, so I am "relieved" that this is not a #3111 regression and we should decided if we make that a rc4 blocker or not.

Contributor

colinsurprenant commented May 5, 2015

ok, so I am "relieved" that this is not a #3111 regression and we should decided if we make that a rc4 blocker or not.

@colinsurprenant

This comment has been minimized.

Show comment
Hide comment
@colinsurprenant

colinsurprenant May 5, 2015

Contributor

Ok, here's the thing: it is totally normal that a plugin, or gem, that is a dependency of another plugin/gem is not uninstalled we asked to do so. To be able to remove it you'll have to remove the plugin/gem that depends on the one you are trying to remove.

I would even add: thanks to bundler for doing that, it avoid potential problem where if you uninstall a dependency, the plugin/gem that depend on it will obviously fail. If you were able to uninstall logstash-input-tcp using logstash-input-syslog would crash.

So, I am not sure how to deal with this, but for me it's more a UI problem. could we check that and report a warning to the user saying: sorry, impossible to uninstall ?

Contributor

colinsurprenant commented May 5, 2015

Ok, here's the thing: it is totally normal that a plugin, or gem, that is a dependency of another plugin/gem is not uninstalled we asked to do so. To be able to remove it you'll have to remove the plugin/gem that depends on the one you are trying to remove.

I would even add: thanks to bundler for doing that, it avoid potential problem where if you uninstall a dependency, the plugin/gem that depend on it will obviously fail. If you were able to uninstall logstash-input-tcp using logstash-input-syslog would crash.

So, I am not sure how to deal with this, but for me it's more a UI problem. could we check that and report a warning to the user saying: sorry, impossible to uninstall ?

@ph

This comment has been minimized.

Show comment
Hide comment
@ph

ph May 5, 2015

Member

Keep in mind some plugins depends on other plugins only to run their tests but this dependencies is specified as a runtime dependency and not a development dependency in their gemspec. There is an open issue to clear them in #2078.

Member

ph commented May 5, 2015

Keep in mind some plugins depends on other plugins only to run their tests but this dependencies is specified as a runtime dependency and not a development dependency in their gemspec. There is an open issue to clear them in #2078.

@suyograo

This comment has been minimized.

Show comment
Hide comment
@suyograo

suyograo May 5, 2015

Member

How about adding a --force option to remove all associated dependencies and plugins by walking the dependency tree? Not sure if this dependency graph/API is available, but just throwing it out there.

Member

suyograo commented May 5, 2015

How about adding a --force option to remove all associated dependencies and plugins by walking the dependency tree? Not sure if this dependency graph/API is available, but just throwing it out there.

@jsvd

This comment has been minimized.

Show comment
Hide comment
@jsvd

jsvd May 6, 2015

Member

I agree that uninstall should not work if other gems depend on it. "can't uninstall this due to dependencies" seems to be the quickest and still sane fix to this situation, as @colinsurprenant suggested.
The current behaviour just isn't right:

% bin/plugin uninstall logstash-input-tcp
Uninstalling logstash-input-tcp
% bin/logstash -e 'input { tcp { port => 3333} } filter { split {} mutate { remove_field => [ "message" ] } } output { stdout { codec => rubydebug } }'
Logstash startup completed
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
Logstash shutdown completed
% bin/plugin uninstall logstash-input-tcp
ERROR: Uninstall Aborted, message: This plugin has not been previously installed, aborting
% bin/logstash -e 'input { tcp { port => 3333} } filter { split {} mutate { remove_field => [ "message" ] } } output { stdout { codec => rubydebug } }'
Logstash startup completed
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
Logstash shutdown completed
Member

jsvd commented May 6, 2015

I agree that uninstall should not work if other gems depend on it. "can't uninstall this due to dependencies" seems to be the quickest and still sane fix to this situation, as @colinsurprenant suggested.
The current behaviour just isn't right:

% bin/plugin uninstall logstash-input-tcp
Uninstalling logstash-input-tcp
% bin/logstash -e 'input { tcp { port => 3333} } filter { split {} mutate { remove_field => [ "message" ] } } output { stdout { codec => rubydebug } }'
Logstash startup completed
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
Logstash shutdown completed
% bin/plugin uninstall logstash-input-tcp
ERROR: Uninstall Aborted, message: This plugin has not been previously installed, aborting
% bin/logstash -e 'input { tcp { port => 3333} } filter { split {} mutate { remove_field => [ "message" ] } } output { stdout { codec => rubydebug } }'
Logstash startup completed
^CSIGINT received. Shutting down the pipeline. {:level=>:warn}
Logstash shutdown completed
@purbon

This comment has been minimized.

Show comment
Hide comment
@purbon

purbon May 6, 2015

Contributor

After talking to @jsvd I removed my comment as It was pointless.

Contributor

purbon commented May 6, 2015

After talking to @jsvd I removed my comment as It was pointless.

@ph

This comment has been minimized.

Show comment
Hide comment
@ph

ph May 6, 2015

Member

Maybe give the user a nice warning message like this?

(taken from the gem)

You have requested to uninstall the gem:
    arr-pm-0.0.9

fpm-1.3.3 depends on arr-pm (~> 0.0.9)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]
Member

ph commented May 6, 2015

Maybe give the user a nice warning message like this?

(taken from the gem)

You have requested to uninstall the gem:
    arr-pm-0.0.9

fpm-1.3.3 depends on arr-pm (~> 0.0.9)
If you remove this gem, these dependencies will not be met.
Continue with Uninstall? [yN]
@purbon

This comment has been minimized.

Show comment
Hide comment
@purbon

purbon May 6, 2015

Contributor

+1 on nice warnings 👍 feedback is always nice.

Contributor

purbon commented May 6, 2015

+1 on nice warnings 👍 feedback is always nice.

@jordansissel

This comment has been minimized.

Show comment
Hide comment
@jordansissel

jordansissel Jun 1, 2015

Contributor

Some users on IRC are reporting this as well

Contributor

jordansissel commented Jun 1, 2015

Some users on IRC are reporting this as well

@suyograo suyograo assigned purbon and unassigned jsvd Jul 15, 2015

@suyograo suyograo added v1.6.0 and removed v1.5.3 labels Jul 22, 2015

@suyograo suyograo added plugin manager and removed v1.6.0 labels Sep 25, 2015

@cdenneen

This comment has been minimized.

Show comment
Hide comment
@cdenneen

cdenneen Nov 2, 2015

understood this is outstanding bug but what is a work around for now?
1.5.4 shipped with mutate locked to 1.0.1 which has a bug in it.
Need to install 1.0.2 but lockfile isn't allowing.

cdenneen commented Nov 2, 2015

understood this is outstanding bug but what is a work around for now?
1.5.4 shipped with mutate locked to 1.0.1 which has a bug in it.
Need to install 1.0.2 but lockfile isn't allowing.

@purbon

This comment has been minimized.

Show comment
Hide comment
@purbon

purbon Nov 3, 2015

Contributor

@cdenneen if you take a look at the .lock file, the only plugin that has mutate as dependency is the multiline filter, a good workaround to fix this for now would be to uninstall the multiline, then update the mutate filter and so on in case you like to have multiline back. hope this helps.

That multiline has as a runtime dependency mutate, makes no sense. Will fix this now.

Contributor

purbon commented Nov 3, 2015

@cdenneen if you take a look at the .lock file, the only plugin that has mutate as dependency is the multiline filter, a good workaround to fix this for now would be to uninstall the multiline, then update the mutate filter and so on in case you like to have multiline back. hope this helps.

That multiline has as a runtime dependency mutate, makes no sense. Will fix this now.

@cdenneen

This comment has been minimized.

Show comment
Hide comment
@cdenneen

cdenneen Nov 5, 2015

Wouldn't the lock file dependency be better using ~> 1.0.1 syntax so all 1.0.x updates are permitted like 1.0.2?

cdenneen commented Nov 5, 2015

Wouldn't the lock file dependency be better using ~> 1.0.1 syntax so all 1.0.x updates are permitted like 1.0.2?

@purbon

This comment has been minimized.

Show comment
Hide comment
@purbon

purbon Nov 30, 2015

Contributor

I amend my previous messages, this is still an issue.

Contributor

purbon commented Nov 30, 2015

I amend my previous messages, this is still an issue.

@purbon

This comment has been minimized.

Show comment
Hide comment
@purbon

purbon Nov 30, 2015

Contributor

A feedback loop has been proposed in #4288, this does not fix the issue per se, but provides feedback to users about the dependency tree involved when trying to uninstall a plugin.

Contributor

purbon commented Nov 30, 2015

A feedback loop has been proposed in #4288, this does not fix the issue per se, but provides feedback to users about the dependency tree involved when trying to uninstall a plugin.

@suyograo suyograo removed the known issue label Sep 14, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment