NOTICE! This is a static HTML version of a legacy Fiji BugZilla bug.

The Fiji project now uses GitHub Issues for issue tracking.

Please file all new issues there.

Bug 336 - proxy not working for updates
proxy not working for updates
Status: RESOLVED FIXED
Product: Fiji
Classification: Unclassified
Component: Other
unspecified
PC Windows
: P2 critical
Assigned To: Johannes Schindelin
Depends on:
Blocks:
 
Reported: 2011-07-19 19:25 CDT by richard cole
Modified: 2012-01-06 00:21 CST
0 users

See Also:


Attachments
A Fiji Updater that should handle proxies with authentication gracefully (208.46 KB, application/octet-stream)
2011-11-08 01:29 CST, Johannes Schindelin

Description richard cole 2011-07-19 19:25:18 CDT
I am struggling to get the updater to work,using the proxy settings.  I get a 407 error even with the correct info entered into the proxy dialog.  The imagej updater (Help>Update ImageJ command )does work.
Comment 1 Johannes Schindelin 2011-07-19 22:59:12 CDT
Does the same happen to Help>Update Fiji? Is your Fiji up-to-date? What type is your proxy? (I asked at least the last question also in a response to the mail on the ImageJ mailing list...)
Comment 2 richard cole 2011-07-20 01:30:30 CDT
(In reply to comment #1)
> Does the same happen to Help>Update Fiji? Is your Fiji up-to-date? What type is
> your proxy? (I asked at least the last question also in a response to the mail
> on the ImageJ mailing list...)
> 

Sorry about the proxy issue, I had asked our IT dept. to respond. We use a proxy server that require authentication, is that what you are asking? The help>update imageJ works w/the newest daily build of imagej so does the open>sample images. My FIJI is close to up to date, not months old maybe weeks old. 
Comment 3 Johannes Schindelin 2011-07-20 10:30:49 CDT
I asked whether the Help>Update Fiji command works not because I wanted you to update, but because I wanted to know whether this is a bug in Fiji or in ImageJ. It appears that Wayne fixed it in the daily builds, so we will get it with the next ImageJ version.
Comment 4 richard cole 2011-08-03 14:09:02 CDT
I updated Fiji from outside the proxy, still does not work from behind the proxy:
Redhat Enterprise Linux v5.x:
squid-2.6.STABLE21-6.el5
Comment 5 Johannes Schindelin 2011-10-19 22:02:16 CDT
ImageJ version?
Comment 6 richard cole 2011-10-19 22:51:59 CDT
(In reply to comment #5)
> ImageJ version?
> 

1.45r  which I believe is the latest
Comment 7 Johannes Schindelin 2011-10-20 00:57:30 CDT
Could you please start Fiji from the command-line, passing the "--console" option? I would really need the verbose console output of that error.
Comment 8 richard cole 2011-10-20 14:48:20 CDT
(In reply to comment #7)
> Could you please start Fiji from the command-line, passing the "--console"
> option? I would really need the verbose console output of that error.
> 

is the console option a startup parameter?
Comment 9 Johannes Schindelin 2011-10-20 19:50:26 CDT
Yes, --console is a command-line parameter: fiji.sc/Debugging#Command_line_debugging
Comment 10 richard cole 2011-10-20 20:25:51 CDT
(In reply to comment #9)
> Yes, --console is a command-line parameter:
> fiji.sc/Debugging#Command_line_debugging
> 

C:\Program Files\fiji-win64-20100614\Fiji.app>fiji-win64.exe --console

C:\Program Files\fiji-win64-20100614\Fiji.app>java.io.IOException: Server return
ed HTTP response code: 407 for URL: http://fiji.sc/update/db.xml.gz
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.j
ava:1491)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpU
RLConnection.java:1485)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1139)
        at fiji.updater.logic.XMLFileDownloader.start(XMLFileDownloader.java:65)

        at fiji.updater.Updater.run(Updater.java:80)
        at ij.IJ.runUserPlugIn(IJ.java:183)
        at ij.IJ.runPlugIn(IJ.java:150)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at ij.Command.runPlugIn(Command.java:146)
        at ij.Command.runCommand(Command.java:95)
        at ij.Executer.run(Executer.java:64)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Server returned HTTP response code: 407 for URL:
 http://fiji.sc/update/db.xml.gz
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1436)
        at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLCon
nection.java:2304)
        at java.net.HttpURLConnection.getHeaderFieldDate(HttpURLConnection.java:
450)
        at java.net.URLConnection.getLastModified(URLConnection.java:532)
        at fiji.updater.logic.XMLFileDownloader.start(XMLFileDownloader.java:63)

        ... 11 more
Comment 11 Johannes Schindelin 2011-10-20 20:43:44 CDT
Thank you very much. I tried to address the issue and built a new Updater. Please download http://fiji.sc/snaps/Fiji_Updater.jar and copy it to C:\Program Files\fiji-win64-20100614\Fiji.app\plugins (overwriting the file of the same name that is already there).

If this turns out to fix the issue, I will upload that version so it will show up as "up-to-date" on your side, too.
Comment 12 richard cole 2011-10-20 21:00:15 CDT
(In reply to comment #11)
> Thank you very much. I tried to address the issue and built a new Updater.
> Please download http://fiji.sc/snaps/Fiji_Updater.jar and copy it to C:\Program
> Files\fiji-win64-20100614\Fiji.app\plugins (overwriting the file of the same
> name that is already there).
> 
> If this turns out to fix the issue, I will upload that version so it will show
> up as "up-to-date" on your side, too.
> 

I download and overwrote the file and I get the following

C:\Program Files\fiji-win64-20100614\Fiji.app>fiji-win64.exe --console

C:\Program Files\fiji-win64-20100614\Fiji.app>java.io.IOException: Server return
ed HTTP response code: 407 for URL: http://fiji.sc/update/db.xml.gz
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
orAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
onstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
        at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.j
ava:1491)
        at java.security.AccessController.doPrivileged(Native Method)
        at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpU
RLConnection.java:1485)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1139)
        at fiji.updater.logic.XMLFileDownloader.start(XMLFileDownloader.java:66)

        at fiji.updater.Updater.run(Updater.java:80)
        at ij.IJ.runUserPlugIn(IJ.java:183)
        at ij.IJ.runPlugIn(IJ.java:150)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at ij.Command.runPlugIn(Command.java:146)
        at ij.Command.runCommand(Command.java:95)
        at ij.Executer.run(Executer.java:64)
        at java.lang.Thread.run(Thread.java:662)
Caused by: java.io.IOException: Server returned HTTP response code: 407 for URL:
 http://fiji.sc/update/db.xml.gz
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLCon
nection.java:1436)
        at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLCon
nection.java:2304)
        at java.net.HttpURLConnection.getHeaderFieldDate(HttpURLConnection.java:
450)
        at java.net.URLConnection.getLastModified(URLConnection.java:532)
        at fiji.updater.logic.XMLFileDownloader.start(XMLFileDownloader.java:64)

        ... 11 more

The imageJ update goes off w/out a hitch, nothing in the console window
Comment 13 Johannes Schindelin 2011-10-20 21:28:41 CDT
Okay, next try. I uploaded another version to the same http://fiji.sc/snaps/Fiji_Updater.jar. Sorry for the slow progress, it would make it easier if I had a setup which only works with an authenticating proxy, but I don't :-(
Comment 14 Johannes Schindelin 2011-10-21 00:04:44 CDT
What I do not understand is that it is a 407, so that would normally mean that it could not authenticate with the proxy. But I do not see any other code in ImageJ to support proxy settings, except server, port, or these system proxy settings. And the system proxy settings should have been used by Fiji already.

Further, even if those settings would not have been used, ImageJ actually sets them globally anyway. So we should inherit them.
Comment 15 richard cole 2011-10-21 14:53:24 CDT
(In reply to comment #14)
> What I do not understand is that it is a 407, so that would normally mean that
> it could not authenticate with the proxy. But I do not see any other code in
> ImageJ to support proxy settings, except server, port, or these system proxy
> settings. And the system proxy settings should have been used by Fiji already.
> 
> Further, even if those settings would not have been used, ImageJ actually sets
> them globally anyway. So we should inherit them.
> 

This is what is confusing me, ImageJ works w/the proxy setting (as you said they are passed foward) I have set & Fiji updates if not behind a firewall?


Comment 16 Johannes Schindelin 2011-10-21 19:20:18 CDT
Is it possible that your proxy requires no password when surfing to http://imagej.nih.gov/ij/ but that it does when surfing to http://fiji.sc/?

To test, you could run this Beanshell script (File>Script>New, paste the script into the newly opened editor, select Language>Beanshell and then run with Run>Run) and then send back the complete output from the output window in the text editor?

fiji.updater.util.Util.useSystemProxies();
print("property: " + System.getProperty("java.net.useSystemProxies"));
url = new URL("http://imagej.nih.gov/ij/notes.html");
url.openConnection().getInputStream().close();
print("Got IJ1 notes");
url = new URL("http://fiji.sc/update/db.xml.gz");
url.openConnection().getInputStream().close();
print("Got Fiji update db");
Comment 17 Johannes Schindelin 2011-10-21 22:54:06 CDT
Hmpf. I tried to set up something similar to your setup, and using that updater I mentioned earlier works for me.

Just to be extra-sure, I also set the respective Java property already in the Fiji launcher.

So this is my last try until I give up (at least for now):

Please download http://fiji.sc/snaps/fiji-win64.exe and http://fiji.sc/snaps/Fiji_Updater.jar and overwrite the respective files in your Fiji.app (the .jar goes into the plugins/ subdirectory). Then restart Fiji and call Help>Update Fiji.

If that does not work, I refer you back to my comment #16, as I suspect your proxy to be really selective in that case and allowing to proxy to imagej.nih.gov but not fiji.sc. If that should be the case, there is unfortunately no way I can help since it would be your network administrator who blocked us out explicitly.
Comment 18 richard cole 2011-11-07 19:42:24 CST
(In reply to comment #17)
> Hmpf. I tried to set up something similar to your setup, and using that updater
> I mentioned earlier works for me.
> 
> Just to be extra-sure, I also set the respective Java property already in the
> Fiji launcher.
> 
> So this is my last try until I give up (at least for now):
> 
> Please download http://fiji.sc/snaps/fiji-win64.exe and
> http://fiji.sc/snaps/Fiji_Updater.jar and overwrite the respective files in
> your Fiji.app (the .jar goes into the plugins/ subdirectory). Then restart Fiji
> and call Help>Update Fiji.
> 
> If that does not work, I refer you back to my comment #16, as I suspect your
> proxy to be really selective in that case and allowing to proxy to
> imagej.nih.gov but not fiji.sc. If that should be the case, there is
> unfortunately no way I can help since it would be your network administrator
> who blocked us out explicitly.
> 

See attached 
Mon Nov  7 12:54:37 2011      4 172.16.2.236 TCP_DENIED/407 566 HEAD
http://fiji.sc/update/db.xml.gz - NONE/- text/html

I was never prompted for a user name/password and our poxy require authincation.
any suggestions???
Comment 19 Johannes Schindelin 2011-11-08 01:29:27 CST
Created attachment 55
A Fiji Updater that should handle proxies with authentication gracefully
Comment 20 Johannes Schindelin 2011-11-08 01:32:07 CST
Richard, could you please download the newly attached Fiji_Updater.jar (based on the current 'updater' branch) and drag 'n drop it on the main Fiji window? After a restart, Help>Update Fiji should ask you for credentials when the proxy requires authentication.

I was on the wrong track all the time since you said that ImageJ updates nicely and I assumed that that means that ImageJ has some special handling for authenticating proxies. However, it seems as if your proxy simply does not require authentication for nih.gov, but it does require it for fiji.sc. *sigh*
Comment 21 Johannes Schindelin 2011-11-09 14:58:20 CST
It would be really, really nice if this could be tested by the original reporter. I sank a substantial amount of time in trying to solve the issue.
Comment 22 richard cole 2011-11-11 17:15:51 CST
(In reply to comment #21)
> It would be really, really nice if this could be tested by the original
> reporter. I sank a substantial amount of time in trying to solve the issue.
> 

Sorry for the delay in responding ( attending a meeting) and some of the ambiquity in this bug. I know that I speak not only for my self but many other users when I say "thanks".  The latest ideration works great!