Opened 7 years ago

Closed 6 years ago

#897 closed defect (fixed)

Check for outdated plugins is broken

Reported by: killyourtv Owned by: zzz
Priority: minor Milestone: 0.9.7
Component: apps/plugins Version: 0.9.5
Keywords: Cc: killyourtv@…
Parent Tickets: Sensitive: no

Description

Steps to reproduce:

  1. Have an old plugin version installed for which there is an updated version available remotely. In my case it was i2pbote 0.2.7-b129 (upstream version is 0.2.8-b132).
  2. Go to http://127.0.0.1:7657/configclients. Click the Check for Updates button for i2pbote.

Result: Checking plugin i2pbote for updates and immediately on the sidebar: No new version is available for plugin i2pbote.

Expected result: Plugin update found

The remote site has been accessible during this testing. Using a script like the following the correct plugin version is found.

#!/bin/sh -e
TZ=UTC
EEPPROXY='127.0.0.1:4444'
I2P=/usr/share/i2p

SOURCES=" \
        http://tjgidoycrw6s3guetge3kvrvynppqjmvqsosmtbmgqasa6vmsf6a.b32.i2p/i2pbote.xpi2p \
"

trap 'rm -rf $TMPDIR; exit' 0 1 2 15
TMPDIR=$(mktemp -d)
cd $TMPDIR

for plugin in $SOURCES; do
    echo -n "checking version of $plugin  ..."
    FILE=`basename $plugin`
    if java -cp $I2P/lib/i2p.jar net.i2p.util.PartialEepGet -p $EEPPROXY $plugin > /dev/null 2>&1; then
        tail -c +41 $FILE; echo
    else
        echo "*** failed to fetch $plugin"
    fi
    rm -f $FILE
done


e.g.

$ ./botecheck 
checking version of http://tjgidoycrw6s3guetge3kvrvynppqjmvqsosmtbmgqasa6vmsf6a.b32.i2p/i2pbote.xpi2p  ...0.2.8-b132

Subtickets

Change History (6)

comment:1 Changed 7 years ago by killyourtv

Summary: Manual plugin check possibly brokenCheck for outdated plugins appears to be broken

I don't know if the automatic check when a new -0 I2P release is installed works. For some reason I had plugin updating disabled in /configadvanced. I don't remember setting that but apparently I did at one time. <shrug>

Clicking "Update all installed plugins" gave the appearance of checking the plugins but it did not find the updated I2PBote plugin.

Clicking the update button for the plugin on /configclients will update the plugin but it appears to unconditionally update. For example:

2013/03/09 12:17:51 | INFO: File [clients.config] extracted
2013/03/09 12:17:51 | INFO: Creating directory [lib/]
2013/03/09 12:17:51 | INFO: File [lib/jamwikiutil.jar.pack] extracted and unpacked
2013/03/09 12:17:51 | INFO: File [plugin.config] extracted
2013/03/09 12:17:51 | INFO: Creating directory [templates/]
2013/03/09 12:17:51 | INFO: Creating directory [templates/etc/]
2013/03/09 12:17:51 | INFO: File [templates/etc/webdefault.xml] extracted
2013/03/09 12:17:51 | INFO: File [templates/etc/realm.properties] extracted
2013/03/09 12:17:51 | INFO: File [templates/jetty.xml] extracted
2013/03/09 12:17:51 | INFO: Creating directory [templates/contexts/]
2013/03/09 12:17:51 | INFO: File [templates/contexts/base-context.xml] extracted
2013/03/09 12:17:51 | INFO: File [templates/contexts/cgi-context.xml] extracted

For the heck of it I clicked update again:

2013/03/09 12:18:08 | INFO: File [clients.config] extracted
2013/03/09 12:18:08 | INFO: Creating directory [lib/]
2013/03/09 12:18:08 | INFO: File [lib/jamwikiutil.jar.pack] extracted and unpacked
2013/03/09 12:18:08 | INFO: File [plugin.config] extracted
2013/03/09 12:18:08 | INFO: Creating directory [templates/]
2013/03/09 12:18:08 | INFO: Creating directory [templates/etc/]
2013/03/09 12:18:08 | INFO: File [templates/etc/webdefault.xml] extracted
2013/03/09 12:18:08 | INFO: File [templates/etc/realm.properties] extracted
2013/03/09 12:18:08 | INFO: File [templates/jetty.xml] extracted
2013/03/09 12:18:08 | INFO: Creating directory [templates/contexts/]
2013/03/09 12:18:08 | INFO: File [templates/contexts/base-context.xml] extracted
2013/03/09 12:18:08 | INFO: File [templates/contexts/cgi-context.xml] extracted

That was for the JAMWiki plugin, a plugin for which there is no updated version.

Also, when I clicked the update button for i2pbote it appeared to extract the plugin twice:

2013/03/14 01:28:33 | Starting I2P 0.9.5-0-deb1
2013/03/14 01:28:33 | INFO: Native CPUID library jcpuid-x86-linux loaded from file
2013/03/14 01:28:33 | INFO: Locally optimized native BigInteger library loaded from file
2013/03/14 01:28:34 | INFO: Jetty 6.1.26 logging to I2P logs using class org.mortbay.jetty.Server
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/i2pbote.jar to classpath for i2pbote
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/mailapi.jar to classpath for i2pbote
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/bcprov-ecc-jdk16-146.jar to classpath for i2pbote
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/flexi-gmss-1.7p1.jar to classpath for i2pbote
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/ntruenc-1.2.jar to classpath for i2pbote
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/scrypt-1.3.3.jar to classpath for i2pbote
2013/03/14 01:28:36 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/lzma-9.20.jar to classpath for i2pbote
2013/03/14 01:28:44 | INFO:BOB is now running.
2013/03/14 01:35:02 | INFO: Creating directory [console/]
2013/03/14 01:35:02 | INFO: Creating directory [console/webapps/]
2013/03/14 01:35:02 | INFO: File [console/webapps/i2pbote.war.pack] extracted and unpacked
2013/03/14 01:35:02 | INFO: File [console/webapps.config] extracted
2013/03/14 01:35:02 | INFO: Creating directory [lib/]
2013/03/14 01:35:02 | INFO: File [lib/flexi-gmss-1.7p1.jar.pack] extracted and unpacked
2013/03/14 01:35:02 | INFO: File [lib/scrypt-1.3.3.jar.pack] extracted and unpacked
2013/03/14 01:35:02 | INFO: File [lib/encrypt.bat] extracted
2013/03/14 01:35:03 | INFO: File [lib/bcprov-ecc-jdk16-146.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/decrypt.bat] extracted
2013/03/14 01:35:03 | INFO: File [lib/i2pbote.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/encrypt.sh] extracted
2013/03/14 01:35:03 | INFO: File [lib/lzma-9.20.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/ntruenc-1.2.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/fileinfo.sh] extracted
2013/03/14 01:35:03 | INFO: File [lib/fileinfo.bat] extracted
2013/03/14 01:35:03 | INFO: File [lib/decrypt.sh] extracted
2013/03/14 01:35:03 | INFO: File [plugin.config] extracted
2013/03/14 01:35:03 | INFO: File [console/webapps/i2pbote.war.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [console/webapps.config] extracted
2013/03/14 01:35:03 | INFO: File [lib/flexi-gmss-1.7p1.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/scrypt-1.3.3.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/encrypt.bat] extracted
2013/03/14 01:35:03 | INFO: File [lib/bcprov-ecc-jdk16-146.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/decrypt.bat] extracted
2013/03/14 01:35:03 | INFO: File [lib/i2pbote.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/encrypt.sh] extracted
2013/03/14 01:35:03 | INFO: File [lib/lzma-9.20.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/ntruenc-1.2.jar.pack] extracted and unpacked
2013/03/14 01:35:03 | INFO: File [lib/fileinfo.sh] extracted
2013/03/14 01:35:03 | INFO: File [lib/fileinfo.bat] extracted
2013/03/14 01:35:03 | INFO: File [lib/decrypt.sh] extracted
2013/03/14 01:35:03 | INFO: File [plugin.config] extracted
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/i2pbote.jar to classpath for i2pbote
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/mailapi.jar to classpath for i2pbote
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/bcprov-ecc-jdk16-146.jar to classpath for i2pbote
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/flexi-gmss-1.7p1.jar to classpath for i2pbote
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/ntruenc-1.2.jar to classpath for i2pbote
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/scrypt-1.3.3.jar to classpath for i2pbote
2013/03/14 01:35:03 | Adding /var/lib/i2p/i2p-config/plugins/i2pbote/lib/lzma-9.20.jar to classpath for i2pbote

I only clicked the Update button once.

comment:2 Changed 7 years ago by killyourtv

Cc: killyourtv@… added

comment:3 Changed 6 years ago by killyourtv

Milestone: 0.9.7
Priority: minormajor
Summary: Check for outdated plugins appears to be brokenCheck for outdated plugins is broken
Version: 0.9.40.9.5

Still a problem with 0.9.6.

comment:4 Changed 6 years ago by zzz

Owner: set to zzz
Status: newaccepted

re: not finding an update (OP)

It looks like a bug.


re: updating when it shouldn't (comment 1):

The "Update" button on /configclients unconditionally downloads (w/o checking the .xpi2p version in the header with eephead), then extracts to a temp dir and does sanity in version checks. If newer, it then extracts the zip again to ~/.i2p/plugins. So you'll see one or two sets of extract messages in wrapper.log.

When I tried updating an already-up-to-date zzzot plugin, I got the following in the router log:

WARN  [onsole Jetty] er.update.ConsoleUpdateManager: Install plugin: zzzot VersionAvailable "" {HTTP=[http://stats.i2p/i2p/plugins/zzzot-update.xpi2p]}
INFO  [onsole Jetty] er.update.ConsoleUpdateManager: Starting RegisteredUpdater net.i2p.router.update.PluginUpdateHandler for PLUGIN HTTP @pri 0
WARN  [pdate Runner] er.update.ConsoleUpdateManager: Failed net.i2p.router.update.PluginUpdateRunner PLUGIN zzzot HTTP http://stats.i2p/i2p/plugins/zzzot-update.xpi2p for PLUGIN: <b>Downloaded plugin version 0.10.0-b1 is not newer than installed plugin</b>
WARN  [pdate Runner] er.update.ConsoleUpdateManager: Nothing left to try for: UpdateItem PLUGIN zzzot

… and a "transfer failed from stats.i2p/…" in the console summary bar. Which isn't the best message.

IIRC the unconditional download behavior has been that way since the beginning.

So you're getting confused by the wrapper.log messages when it extracts to a temp dir. Perhaps we should hide that?

And should we check the header before downloading the whole thing?

comment:5 Changed 6 years ago by zzz

Priority: majorminor

OP fixed in 0.9.6-15-rc 8ba9ef85b8131d36e36b95a59bd7831bba50be8d, it was broken since the beginning of the new update subsystem (0.9.4). I think it may have been checking the plugin version against the router version. Not sure how it got missed.

Also in that rev, reduce the logging in FileUtil?.extractZip() by default, and don't log at all when extracting the xpi2p file to the temp dir.

Leaving ticket open to consider whether to have the update button check the version before downloading. Reducing to minor.

comment:6 Changed 6 years ago by zzz

Resolution: fixed
Status: acceptedclosed

No, not checking. Closing as fixed in 0.9.7.

Note: See TracTickets for help on using tickets.