Ticket #286 (new defect)

Opened 12 years ago

Last modified 11 years ago

Proxy Server Issues

Reported by: kmaclean Owned by: kmaclean
Priority: major Milestone: SpeechSubmission 0.1.8
Component: SpeechSubmission Version: SpeechSubmission 0.1
Keywords: Cc:

Description

from David Gelbart:

About my submission problem:

I tried submitting again several more times (reloading the page to get fresh sentence prompts each time) and each time the upload hung 50%-70% of the way through the progress bar. If I try to trace the upload traffic using Wireshark, it seems to be going through the Web proxy server I normally use. Maybe the proxy is causing the problem. I tried changing the Firefox and Java settings to not use the proxy, but weirdly the upload still seems to be going through the proxy. So I might have to reboot to get the upload to stop using the proxy, but right now is not a convenient time to reboot so I will leave that for another day. I am using Firefox 2.0.0.9 on Windows XP SP2 with Java SE 6.

I have attached the Java console log from my last attempt. I closed the application while the 'CapturePlayback? Cookie' messages were still streaming by, but in the previous attempt I left it running and those 'CapturePlayback? Cookie' messages kept going and going until finally the application terminated with this error:

Exception in thread "Thread-159" java.lang.StackOverflowError?

at java.net.SocketOutputStream?.socketWrite0(Native Method) at java.net.SocketOutputStream?.socketWrite(Unknown Source) at java.net.SocketOutputStream?.write(Unknown Source) at java.io.BufferedOutputStream?.flushBuffer(Unknown Source) at java.io.BufferedOutputStream?.flush(Unknown Source) at java.io.DataOutputStream?.flush(Unknown Source) at net.sf.postlet.UploadThread?.uploadFile(UploadThread?.java:109) at net.sf.postlet.UploadThread?.upload(UploadThread?.java:83) at net.sf.postlet.UploadThread?.run(UploadThread?.java:65) at net.sf.postlet.UploadThread?.run(UploadThread?.java:75) at net.sf.postlet.UploadThread?.run(UploadThread?.java:75) at net.sf.postlet.UploadThread?.run(UploadThread?.java:75) at net.sf.postlet.UploadThread?.run(UploadThread?.java:75) at net.sf.postlet.UploadThread?.run(UploadThread?.java:75)

...

The line "net.sf.postlet.UploadThread?.run(UploadThread?.java:75)" was repeated many, many more times.

Attachments

success.txt.gz (11.3 KB) - added by kmaclean 12 years ago.
console output from the following console output from successful upload without the proxy

Change History

comment:1 Changed 12 years ago by kmaclean

Hi Ken,

I increased the Java console trace level to 2 (by pressing 2 in the console), which allowed me to see that the upload attempts were definitely going through the Web proxy server.

I then noticed that the Java console lets me 'reload proxy configuration' by pressing p. So I did so, and Java stopped using the proxy. My next attempt to submit speech was successful.

In case you are interested, I've included below an excerpt of the console output when I first increased the trace level to 2, and I have attached (as success.txt.gz) the console output from the following successful upload without the proxy.

Temp Speex file: C:\DOCUME~1\David\LOCALS~1\Temp\mdl40392.spx
Destination URL is http://read.voxforge1.org/javaUploadServer.php
Adding b0115.wav
Adding b0116.wav
Adding b0117.wav
Adding b0118.wav
Adding b0119.wav
Adding b0120.wav
Adding b0121.wav
Adding b0122.wav
Adding b0123.wav
Adding b0124.wav
Adding prompts.txt
Adding readme.txt
Adding license.txt
Adding GPL_license.txt
Adding completed OK
Archive file
location:C:\DOCUME~1\David\LOCALS~1\Temp\VF-dir40390.tmp\anonymous-20071112-zfh.zip
Uploading to http://read.voxforge1.org/javaUploadServer.php
PROXY HOST: proxy.lib.berkeley.edu
PROXY PORT: 80
PROXY TYPE: 3
network: Connecting socket://proxy.lib.berkeley.edu:80 with proxy=DIRECT
After adding the URL variables to the string, it looks like this:
-----------------------------yizcdmcyeadjdrdgiqpjqcpjojmxexfgicprxzon
Content-Disposition: form-data; name="userfile";
filename="anonymous-20071112-zfh.zip"
Content-Type: application/octet-stream


CapturePlayback Cookie: :

CapturePlayback Cookie: :

setProgress(): Not reached end yet. sentBytes=1024, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=2048, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=3072, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=4096, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=5120, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=6144, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=7168, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=8192, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=9216, totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=10240,
totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=11264,
totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=12288,
totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=13312,
totalBytes=2721034
setProgress(): Not reached end yet. sentBytes=14336,
totalBytes=2721034

And so on. I terminated the application at that point, since I expected the upload to hang as it did earlier.

Regards,

Changed 12 years ago by kmaclean

console output from the following console output from successful upload without the proxy

comment:2 Changed 12 years ago by kmaclean

Hi David,

Thanks. I never even though there might be proxy issues. I'll have to create a note or a reference to a FAQ for people using proxies.

See Ticket #287

comment:3 Changed 12 years ago by kmaclean

reviewing UploadThread.java, and noticed this code:

		// The request includes the absolute URI to the script which will
		// accept the file upload.  This is perfectly valid, although it is
		// normally only used by a client when connecting to a proxy server.
		// COULD CREATE PROBLEMS WITH SOME WEB SERVERS.
		request="POST " + url.toExternalForm() + " HTTP/1.1" + lineEnd;

		// Host that we are sending to (not necesarily connecting to, if behind
		// a proxy)
		header +="Host: " + url.getHost() + lineEnd;

comment:4 Changed 12 years ago by kmaclean

  • Milestone changed from SpeechSubmission 0.1.3 to SpeechSubmission 0.1.2

comment:5 Changed 12 years ago by kmaclean

  • Milestone changed from SpeechSubmission 0.1.2 to SpeechSubmission 0.1.3

comment:6 Changed 12 years ago by kmaclean

comment:7 Changed 12 years ago by kmaclean

See Java 1.5.0 Proxy Configuration page

java.net.ProxySelector? API in J2SE 5.0

Developers may sometimes need to determine the proxy configuration of a given host. By knowing the proxy configuration they can write more intelligent code to connect to the host through the proper proxy server. In J2SE 5.0, java.net.ProxySelector? is a new API for proxy configuration support. Here is a simple code example:

private Proxy findProxy(URI uri) {

try {

ProxySelector? selector = ProxySelector?.getDefault(); List<Proxy> proxyList = selector.select(uri); if (proxyList.size() > 1)

return proxyList.get(0);

} catch (IllegalArgumentException? e) { } return Proxy.NO_PROXY;

}

comment:8 Changed 12 years ago by kmaclean

  • Milestone changed from SpeechSubmission 0.1.3 to SpeechSubmission 0.1.4

comment:9 Changed 11 years ago by kmaclean

The VoxForge speech submission app uses code from the poslet upload applet. There is information on the postlet site that addresses how to deal with proxies:

For users behind a proxy server, you need to ensure that Java is correctly set up on your machine.

To set the proxy server for your JRE, assuming you're using the SUN JRE, then do the following steps:

  • Open the JRE control panel. On windows this is located in the system control panel under Java (Start -> Control Panel -> Java - If this isn't visible, ensure you're using "Classic View", and not "Category View"). On Linux, this can be located by using the output of $ which java . This will likely point (after symbolic links) to something like /usr/lib/jvm/jre-1.5.0-sun/bin/java . The ControlPanel can be executed by substituting java on the end of this with ControlPanel .
  • Click the "General" tab, and then click the "Network Settings..." button. Enter the proxy settings as stipulated by your local systen administrator
  • Restart your web browser.
  • Postlet will now use the proxy connection settings that you have specified.

For users of other JREs, including Mac users, please refer to the supplier of your JRE for changing the above settings.

Note: See TracTickets for help on using tickets.