CATS Proxy Authentication?

11 replies [Last post]
User offline. Last seen 1 hour 41 min ago. Offline
Fellow
Joined: 2010-05-31

I'm new to ORE (been over at Burp for a few years) and I just figured I'd ask my CATS question over here. I was testing using [url=http://burp.renderfarming.net/forum_thread.php?id=1288&nowrap=true#9788]CATS with a proxy[/url]. Not sure if it's the same group of developers (if so, I'm sorry for cross posting).

Anyway, I downloaded a fresh copy of [url=http://www.renderfarm.fi/cats]renderfarm.fi's CATS[/url] and the latest JRE 6.0_20 (linux x64) from [url=http://java.com]java.com[/url].

I connect direct (the first time) to get in and set the proxy (from within CATS). When I enter my settings and click OK, I see the following in the console window...

Testing http://192.168.1.1:3128http://www.google.com
null
HTTP/1.1 200 OK
Date
Tue, 01 Jun 2010 15:33:14 GMT
Transfer-Encoding
chunked
Expires
-1
X-XSS-Protection
1; mode=block
Set-Cookie
PREF=ID=817ece300ff15afa:TM=1275406394:LM=1275406394:S=nRBqOmzbwIECCDgF; expires=Thu, 31-May-2012 15:33:14 GMT; path=/; domain=.google.de
Content-Type
text/html; charset=ISO-8859-1
Server
gws
Cache-Control
private, max-age=0
Using Proxy: 192.168.1.1
Using Proxy Port: 3128

It appears to be successful testing the proxy.

So I exit CATS, disable my (direct) internet access and try to only use the proxy to connect. This time CATS times out with this in the console...

Jun 1, 2010 12:08:31 PM cats.core.Core createProjects
SEVERE: null
org.apache.xmlrpc.XmlRpcException: Failed to create input stream: [b]Server returned HTTP response code: 400 for URL: http://192.168.1.1:3128nullsession.php[/b]
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:91)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:144)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
at cats.core.XMLRPC.getList(XMLRPC.java:70)
at cats.domain.Project.getSessionsInQueue(Project.java:162)
at cats.domain.Project.loadWaitingSessions(Project.java:96)
at cats.core.Core.createProjects(Core.java:344)
at cats.core.Core.initialize(Core.java:295)
at cats.Main.main(Main.java:38)
Caused by: java.io.IOException: [b]Server returned HTTP response code: 400 for URL: http://192.168.1.1:3128nullsession.php[/b]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:89)
... 13 more
Caused by:
java.io.IOException: [b]Server returned HTTP response code: 400 for URL: http://192.168.1.1:3128nullsession.php[/b]
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.getInputStream(XmlRpcSunHttpTransport.java:89)
at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:144)
at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
at org.apache.xmlrpc.client.XmlRpcSunHttpTransport.sendRequest(XmlRpcSunHttpTransport.java:69)
at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:137)
at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:126)
at cats.core.XMLRPC.getList(XMLRPC.java:70)
at cats.domain.Project.getSessionsInQueue(Project.java:162)
at cats.domain.Project.loadWaitingSessions(Project.java:96)
at cats.core.Core.createProjects(Core.java:344)
at cats.core.Core.initialize(Core.java:295)
at cats.Main.main(Main.java:38)

It seems to use the proxy for downloading frames, but not for connecting to the project. Kind of a catch-22 (can't download, if I can't connect).

A proxy environment variable, or "use system's proxy settings" would be helpful on startup.

Hope this is helpful.

..also the forum editor preview seems quirky (for me).

User offline. Last seen 18 hours 58 min ago. Offline
Project administrator
Joined: 2008-11-26
Is the problem still there?

Is the problem still existing?

Julius Tuomisto Project Administrator Laurea SID Networks, Espoo, Finland Tel. +358-50-4135412

jbk
User offline. Last seen 2 weeks 18 hours ago. Offline
BURP Ninja
Joined: 2008-10-05
Think so, at least I didn't

Think so, at least I didn't touch it =)

User offline. Last seen 1 hour 41 min ago. Offline
Fellow
Joined: 2010-05-31
Just tried again. Downloaded

Just tried again. Downloaded the same version of cats, and now get a version error for both renderfarm.fi and burp.renderfarming.net

"Could not attach to http://www.renderfarm.fi not a BURP-based project or not using the correct version of CATS"

Couldn't get any further.

User offline. Last seen 1 hour 41 min ago. Offline
Fellow
Joined: 2010-05-31
Successful CATS Hack?

I've been hacking at CATS all day and think I figured out the proxy issue (this was my first look at java code).

I managed to track it down to the getBaseURL() function in /src/cats/domain/Project.java The connection instruction doesn't check the proxy settings. I changed this...

<code>
     HttpURLConnection conn = (HttpURLConnection) ((new URL(url)).openConnection());
</code>

...to this...

<code>
     URL correctURL = null;
     URL proxyURL = Core.getProxyURL();
     if (proxyURL == null){
       correctURL = new URL(url);
     }else{
       correctURL = new URL("http",proxyURL.getHost(),proxyURL.getPort(),url);
     }

     HttpURLConnection conn = (HttpURLConnection)correctURL.openConnection();
</code>

It now appears to be attaching under a proxy (when configured). But now fails to get files in the DownloaderThread :( So I put similar code in the loadFiles() function of /src/cats/domain/Frame.java

Added...

<code>
     URL correctURL = null;
     URL proxyURL = Core.getProxyURL();
     if (proxyURL == null){
       correctURL = new URL((String)fileMap.get("url"));
     }else{
       correctURL = new URL("http",proxyURL.getHost(),proxyURL.getPort(),(String)fileMap.get("url"));
     }
</code>

...and replaced <code>new URL((String)fileMap.get("url"))</code> with <code>correctURL</code> in the imageFiles.put() function

There's still the issue of a new user without a cats.cfg file. They can't attach the first time if they're behind a proxy because there's no option in the GUI to setup the proxy (until after they connect). But I'll leave that to the experts.

Of course it's not "live" until one of you admins makes the changes to the real code (and verifies my work!). Hopefully my hacks didn't break anything else. :)

User offline. Last seen 18 hours 58 min ago. Offline
Project administrator
Joined: 2008-11-26
We'll take a look next week

Thanks alot for the code suggestion Overkill. I promise we'll take a look at it during next week :).

Julius Tuomisto Project Administrator Laurea SID Networks, Espoo, Finland Tel. +358-50-4135412

User offline. Last seen 1 hour 41 min ago. Offline
Fellow
Joined: 2010-05-31
CATS file names (0001.png)

Thanks for following up on CATS. I hope it helps.

I was just using CATS to download my frames (session 469) and realized the filenames are padded with 3 zeros (%03d) but my session has over 1000 frames. So frame "999.png" doesn't sort nicely with frame "1000.png".  :(

Looked at the code and noticed a (hidden?) format "%f4id" for 4 zeros (%04d) in DownloaderThread.java. Can this be the new default when configuring the filename syntax?

Thanks.

jbk
User offline. Last seen 2 weeks 18 hours ago. Offline
BURP Ninja
Joined: 2008-10-05
If you can verify that

If you can verify that Blender loads in these files without any issues then sure it can.

User offline. Last seen 1 hour 41 min ago. Offline
Fellow
Joined: 2010-05-31
CATS "Zero" Hack

I wouldn't think Blender cares either way. It's just the local filename and shouldn't affect burp or blender at all. I did a few tests with blender (2.52) and it appears they use %04d for the .png files it creates (while rendering animations).

Ideally CATS could do some fancy determination based on the last frame rendered (i.e. if the last frame is "100", use %03d, if frame "1000" use %04d, if frame "10000" use %05d, etc.). This is probably "overkill" :) , but I modified more code to make the zero prefix length automatic...

.
Updated the Locales files and StartDownloadFrame.* files to make "%f0id" the defailt for "Zero prefixed frame number" (search/replaced "%f3id" with "%f0id"). Then examined the length of getEndFrame() to determine the correct padding...

In DownloaderThread.java I removed the %03d and %04d lines...

<code>
     filename = filename.replace("%f3id", String.format("%03d", frm.getFrameNumber()));
     filename = filename.replace("%f4id", String.format("%04d", frm.getFrameNumber()));
</code>

And added the following to automatically adjust the prefix ("%f0id").

<code>
     String endFrame = ""+downloadSpec.getEndFrame();
     String autofmt = "%0"+endFrame.length()+"d";
     filename = filename.replace("%f0id", String.format(autofmt, frm.getFrameNumber()));
</code>

Tested on session 1031 (1-1 frames). It formatted with "%01d" (1.png)
Tested session 271 (1-25 frames). It formatted with "%02d" (01.png-25.png)
Tested session 526 (1-200 frames). It formatted with "%03d" (001.png-200.png)
And tested session 932 (810-1830 frames) It formatted with "%04d" (0810.png-1830.png)

Hope it makes the next version.

User offline. Last seen 1 hour 41 min ago. Offline
Fellow
Joined: 2010-05-31
CATS Update?

I downloaded CATS and wanted to bump this thread again to see if anyone (devs) has had a chance to look at it. I'm using my "overkill version" with these changes, and it seems to be working well (proxy authentication & zero prefixed filenames).

User is online Online
Maintainer, developer
Joined: 2009-07-21
http://development.burp.rende

http://development.burp.renderfarming.net/issues/82#change-363

File naming changed 3 days ago. I'll recompile a new CATS for us.

- Jesse Kaukonen, www.jessekaukonen.net

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.