-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
bugSomething isn't workingSomething isn't working
Description
I'm getting the error below when requesting video sessions to the RawStatisticsApi.
Steps to reproduce
Run the program below, after replacing "APIKEY" and "VIDEOID" by a working API key and an existing video identifier.
import video.api.client.ApiVideoClient;
import video.api.client.api.ApiException;
import video.api.client.api.models.*;
import video.api.client.api.clients.RawStatisticsApi;
import java.util.*;
public class ApiVideoGetVideoCount
{
public static void main(String[] args) {
ApiVideoClient client = new ApiVideoClient("APIKEY");
RawStatisticsApi apiInstance = client.rawStatistics();
String videoId = "VIDEOID";
String period = "2022-11-15";
Map<String, String> metadata = new HashMap();
Integer currentPage = 1;
Integer pageSize = 25;
try {
Page<VideoSession> result = apiInstance.listVideoSessions(videoId, period)
.metadata(metadata)
.currentPage(currentPage)
.pageSize(pageSize)
.execute();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling RawStatisticsApi#listVideoSessions");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getMessage());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Results
The request is executed successfully when using the current day as a period (eg "2022-12-12"). However when using a day in the past (eg "2022-11-15") or a period covering a month (eg "2022-11") or a year (eg "2022"), the error below with a SocketTimeoutException is raised. The video used in this bug report was uploaded in October 2022.
Exception when calling RawStatisticsApi#listVideoSessions
Status code: 0
Reason: java.net.SocketTimeoutException: timeout
Response headers: null
video.api.client.api.ApiException: java.net.SocketTimeoutException: timeout
at video.api.client.api.ApiClient.execute(ApiClient.java:883)
at video.api.client.api.clients.RawStatisticsApi.listVideoSessionsWithHttpInfo(RawStatisticsApi.java:784)
at video.api.client.api.clients.RawStatisticsApi.access$1300(RawStatisticsApi.java:30)
at video.api.client.api.clients.RawStatisticsApi$APIlistVideoSessionsRequest.execute(RawStatisticsApi.java:912)
at ApiVideoGetVideoCount.main(ApiVideoGetVideoCount.java:29)
Caused by: java.net.SocketTimeoutException: timeout
at okio.Okio$4.newTimeoutException(Okio.java:232)
at okio.AsyncTimeout.exit(AsyncTimeout.java:286)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:241)
at okio.RealBufferedSource.indexOf(RealBufferedSource.java:358)
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:230)
at okhttp3.internal.http1.Http1ExchangeCodec.readHeaderLine(Http1ExchangeCodec.java:242)
at okhttp3.internal.http1.Http1ExchangeCodec.readResponseHeaders(Http1ExchangeCodec.java:213)
at okhttp3.internal.connection.Exchange.readResponseHeaders(Exchange.java:115)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at video.api.client.api.ApiClient$2.intercept(ApiClient.java:1258)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:43)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:94)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at video.api.client.api.auth.ApiVideoAuthInterceptor.intercept(ApiVideoAuthInterceptor.java:35)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:142)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:117)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:229)
at okhttp3.RealCall.execute(RealCall.java:81)
at video.api.client.api.ApiClient.execute(ApiClient.java:879)
... 4 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.base/java.net.SocketInputStream.socketRead0(Native Method)
at java.base/java.net.SocketInputStream.socketRead(SocketInputStream.java:115)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:168)
at java.base/java.net.SocketInputStream.read(SocketInputStream.java:140)
at java.base/sun.security.ssl.SSLSocketInputRecord.read(SSLSocketInputRecord.java:478)
at java.base/sun.security.ssl.SSLSocketInputRecord.readHeader(SSLSocketInputRecord.java:472)
at java.base/sun.security.ssl.SSLSocketInputRecord.bytesInCompletePacket(SSLSocketInputRecord.java:70)
at java.base/sun.security.ssl.SSLSocketImpl.readApplicationRecord(SSLSocketImpl.java:1454)
at java.base/sun.security.ssl.SSLSocketImpl$AppInputStream.read(SSLSocketImpl.java:1065)
at okio.Okio$2.read(Okio.java:140)
at okio.AsyncTimeout$2.read(AsyncTimeout.java:237)
... 31 more
Process finished with exit code 0
Environment
- Java version: OpenJDK 64-Bit Server VM (build 11.0.17+8-post-Ubuntu-1ubuntu222.04, mixed mode, sharing)
- API client version: java-api-client 1.2.7
Additional context
- Example of a public video identifier which raises the issue : vi3zHNNvOEkktkWGXdwJvK8Y
- Any video in my workspace triggers the issue, both in the sandbox and the production environments
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working