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

[ v0.9.3-beta ] Replay vault: search for ID throws an error if query contains non numeric characters #1097

Closed
tatsujb opened this issue Jan 21, 2019 · 4 comments
Labels
S3 normal severity 3 - normal - regular issue, some loss of functionality under specific circumstances

Comments

@tatsujb
Copy link
Contributor

tatsujb commented Jan 21, 2019

Searching with any option and any keyword under the "Vault" -> "Online Replays" tab results in this
screenshot from 2019-01-21 18-02-33

Here is the content of the Stacktrace :

java.util.concurrent.CompletionException: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$3(AsyncExecutionAspectSupport.java:279)
	at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1700)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1135)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: org.springframework.web.client.HttpClientErrorException$BadRequest: 400 Bad Request
	at org.springframework.web.client.HttpClientErrorException.create(HttpClientErrorException.java:79)
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:97)
	at org.springframework.web.client.DefaultResponseErrorHandler.handleError(DefaultResponseErrorHandler.java:79)
	at com.faforever.client.api.JsonApiErrorHandler.handleError(JsonApiErrorHandler.java:31)
	at org.springframework.security.oauth2.client.http.OAuth2ErrorHandler.handleError(OAuth2ErrorHandler.java:172)
	at org.springframework.web.client.ResponseErrorHandler.handleError(ResponseErrorHandler.java:63)
	at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:777)
	at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:735)
	at org.springframework.security.oauth2.client.OAuth2RestTemplate.doExecute(OAuth2RestTemplate.java:128)
	at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:669)
	at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:310)
	at com.faforever.client.api.FafApiAccessorImpl.getPage(FafApiAccessorImpl.java:587)
	at com.faforever.client.api.FafApiAccessorImpl.getPage(FafApiAccessorImpl.java:574)
	at com.faforever.client.api.FafApiAccessorImpl.findReplaysByQuery(FafApiAccessorImpl.java:322)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:206)
	at com.sun.proxy.$Proxy60.findReplaysByQuery(Unknown Source)
	at com.faforever.client.remote.FafService.findReplaysByQuery(FafService.java:299)
	at com.faforever.client.remote.FafService$$FastClassBySpringCGLIB$$6c91c77e.invoke(<generated>)
	at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)
	at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746)
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
	at org.springframework.aop.interceptor.AsyncExecutionInterceptor.lambda$invoke$0(AsyncExecutionInterceptor.java:115)
	at org.springframework.aop.interceptor.AsyncExecutionAspectSupport.lambda$doSubmit$3(AsyncExecutionAspectSupport.java:276)
	... 4 more

for reference I am using this guide : https://youtu.be/RRINgZQl7LU
(text version here : https://pastebin.com/jNrTFxvV )

with the sole difference of having made all of the contents of $HOME/.faforever/bin executable on top of the other things I do in my guide.

(search under maps and mods works)

@Brutus5000
Copy link
Member

This only happens if you give an alphanumeric value for the ID property because our API expects a number here. On the title, this does not throw an error.

This is not a Linux issue. All platforms are affected.

Unfortunately, this is not easily solvable. JSONAPI declares ID to be a String, but technically it remains a number in the database. I will try to tackle this in the query criteria refactor I am working on.

@Brutus5000 Brutus5000 changed the title [ Linux ] [ v0.9.3-beta ] search in the online replay vault tab [ v0.9.3-beta ] Replay vault: search with name in ID field throws an error Feb 13, 2019
@Brutus5000 Brutus5000 added S4 minor severity 4 - minor - minor loss of function, or other problem where easy workaround is present and removed linux labels Feb 13, 2019
@Geosearchef Geosearchef changed the title [ v0.9.3-beta ] Replay vault: search with name in ID field throws an error [ v0.9.3-beta ] Replay vault: search for ID throws an error if query contains non numeric characters Mar 4, 2019
@Geosearchef Geosearchef added S3 normal severity 3 - normal - regular issue, some loss of functionality under specific circumstances and removed S4 minor severity 4 - minor - minor loss of function, or other problem where easy workaround is present labels Mar 4, 2019
@Geosearchef
Copy link
Member

This also happens when using contains and entering any ID as the api probably doesn't expect the non numeric stars in the id:

https://api.faforever.com/data/game?filter=id==%22*9351058*%22

@Chubbly
Copy link

Chubbly commented Mar 11, 2019

For further information, at least part of this bug appears to be intermittent and related specifically to Download's client, not the API call. In my client (0.9.3 beta) from New Zealand, all search requests return a 400 Bad Request error. However, a friend of mine in Germany tried the ID search and had no issues. I mention the countries just on the off-chance it is relevant.

Also, I have no issues when doing a similar search using the legacy client.

@Sheikah45
Copy link
Member

Cannot reproduce in current client

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S3 normal severity 3 - normal - regular issue, some loss of functionality under specific circumstances
Projects
None yet
Development

No branches or pull requests

5 participants