#2013 Fanr issues

tcolar Mon 27 Aug 2012

I've seen some issues with fanr, so reporting it here:

  • WebModAuth : the auth methods allow to return true or false but that do not provide a way to explain why ... I guess it's ok, but sometimes an explanation would be useful.

When there are errors in the publish and the like methods, the error reporting is failing, at least on my machine.

I would get something like:

ERROR: publish command failed
fanr::RemoteErr: Cannot parse response as JSON [100]
use -errTrace for full stack trace

That is not the actual error though, an issue is coming up when it's trying to parse the error ... I see in WebRepo at line 101 it's checking f the status code is not 100 then it will parse the message and throw a proper (JSON) error but this desn't happen because I've found the status code is always coming as 100 ... I've found that this is caused by the line 98 (expect : "100-continue") and that without that the status code arrives properly (not sure if that is a bug of it's own ? ) and errTrace does not help.

I've tried to remove the 100-continue header and while the status code comes in correctly it still fails, it seem to time ut and error out trying to parse the json error message:

ERROR: publish command failed
fanr::RemoteErr: Cannot parse response as JSON [500]
fanr::WebRepo.parseRes (WebRepo.fan:208)
fanr::WebRepo.publish (WebRepo.fan:101)
fanr::PublishCmd.publish (PublishCmd.fan:72)
fanr::PublishCmd.run (PublishCmd.fan:43)
fanr::Main.main (Main.fan:52)
java.lang.reflect.Method.invoke (Method.java:601)
fan.sys.Method.invoke (Method.java:558)
fan.sys.Method$MethodFunc.callOn (Method.java:230)
fan.sys.Method.callOn (Method.java:139)
fanx.tools.Fan.callMain (Fan.java:175)
fanx.tools.Fan.executeType (Fan.java:140)
fanx.tools.Fan.execute (Fan.java:41)
fanx.tools.Fan.run (Fan.java:298)
fanx.tools.Fan.main (Fan.java:336)
Cause:
sys::ParseErr: Unexpected token 69
util::JsonInStream.err (JsonInStream.fan:259)
util::JsonInStream.parseVal (JsonInStream.fan:107)
util::JsonInStream.readJson (JsonInStream.fan:41)
fanr::WebRepo.parseRes (WebRepo.fan:206)
fanr::WebRepo.publish (WebRepo.fan:101)
fanr::PublishCmd.publish (PublishCmd.fan:72)
fanr::PublishCmd.run (PublishCmd.fan:43)
fanr::Main.main (Main.fan:52)
java.lang.reflect.Method.invoke (Method.java:601)
fan.sys.Method.invoke (Method.java:558)
fan.sys.Method$MethodFunc.callOn (Method.java:230)
fan.sys.Method.callOn (Method.java:139)
fanx.tools.Fan.callMain (Fan.java:175)
fanx.tools.Fan.executeType (Fan.java:140)
fanx.tools.Fan.execute (Fan.java:41)
fanx.tools.Fan.run (Fan.java:298)
fanx.tools.Fan.main (Fan.java:336)

Also while I'm at it at Main:57, it would probably make sense to show at least the Err message along with the "Command failed" message, as that's much more informative.

tcolar Mon 27 Aug 2012

Never mind the lats bit about Main, i see it would display the error correctly if it was not for the other issues.

brian Tue 28 Aug 2012

fanr::RemoteErr: Cannot parse response as JSON 100

That just means that HTTP 100 was returned and the content wasn't JSON. There isn't much too it. That HTTP POST requires expect-continue behavior. @SlimerDude had similiar problem trying to use an HTTP proxy 1984.

tcolar Tue 28 Aug 2012

hum ok. the thing is that I have no proxy involved here. I am going directly to wisp . well i am using draft but still its all fantom.

andy Tue 28 Aug 2012

well i am using draft but still its all fantom.

Draft runs a primitive proxy server between processes in development mode:

https://bitbucket.org/afrankvt/draft/src/b54108955fc6/src/fan/Dev.fan#cl-155

Mostly likely a bug or missing use case in Draft (or WebClient) - if you wanted to dig around and see.

tcolar Tue 28 Aug 2012

Thanks, got all of that working properly by adding 100-continue support to draft.

Login or Signup to reply.