While using Youtube API samples for Java for uploading a file to youtube, I get this:
Error at line: Video returnedVideo = videoInsert.execute();
Error Stack
com.google.api.client.googleapis.json.GoogleJsonResponseException: 500 Internal Server Error
{
"code" : 500,
"message" : null
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:423)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
at com.omp.util.YoutubeUtil.uploadVideo(YoutubeUtil.java:141)
A related issue is already raised here: https://code.google.com/p/gdata-issues/issues/detail?id=6352
Resolved automatically after a day or two! Definitely an API problem.
Related
I have been setup an identity server using wso2 and already got a token, but when I used the token to get userinfo I get an internal server error.
request body to get token.
grant_type=password&username=erwin&password=admin&scope=openid
token result
{
"access_token": "9689f5f4-8ba0-398c-91d0-46dfac85b64a",
"refresh_token": "497e57a4-21ff-3dca-a97f-687446c25321",
"scope": "openid",
"id_token": "eyJ4NXQiOiJOVEF4Wm1NeE5ETXlaRGczTVRVMVpHTTBNekV6T0RKaFpXSTRORE5sWkRVMU9HRmtOakZpTVEiLCJraWQiOiJOVEF4Wm1NeE5ETXlaRGczTVRVMVpHTTBNekV6T0RKaFpXSTRORE5sWkRVMU9HRmtOakZpTVEiLCJhbGciOiJSUzI1NiJ9.eyJhdF9oYXNoIjoiU0U4OVRxTkt2U3JWSWRnVXk2eE5XQSIsImFjciI6InVybjptYWNlOmluY29tbW9uOmlhcDpzaWx2ZXIiLCJzdWIiOiJlcndpbiIsImF1ZCI6WyJuU08xSTQyZ043a1JYZE9CdXdZbXNBMTdDY29hIl0sImF6cCI6Im5TTzFJNDJnTjdrUlhkT0J1d1ltc0ExN0Njb2EiLCJpc3MiOiJsb2NhbGhvc3QiLCJleHAiOjE1MTUwMzM3NDQsImlhdCI6MTUxNTAzMDE0NH0.Vz5K38k3UivwayYQWQVO86njwI48I5KpZiEqwrXethIZQ990JYZ1U6MiFEuKzA5Z3AZkDH2_HmHQeTSrjb7GUlIwejOtl7ky6Wc6uAD3a6YidWHAb1BLygX91KNwYdmgZ5ReyrJyZQ5Vri1qOhFfPFHKzkTgyKFZtJDDNvQ_SL8MxyaPer4rneEziXyYxZKJ0RrTnhOJVQ-TE0TxszlvNW4wAzmk_eVu9JDEycJdwAo1GS4U8tjqJPrMRdZNp371rS_-HHa5oSl-wVCEswtsKEoV5UeqKIeJoj0yGIFRqJxhpY9yxMSn-6jeviRBh40QstDNxFeluDpC8B6o7YIzmA",
"token_type": "Bearer",
"expires_in": 3594
}
And I use that access token to get user info,
https://localhost:9443/oauth2/userinfo?schema=openid
Authorization : Bearer 9689f5f4-8ba0-398c-91d0-46dfac85b64a
Method : GET
The Result is error
Exception report
message org.apache.cxf.interceptor.Fault
description The server encountered an internal error that prevented it from fulfilling this request.
exception
java.lang.RuntimeException: org.apache.cxf.interceptor.Fault
org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:116)
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:336)
...
root cause
org.apache.cxf.interceptor.Fault
org.apache.cxf.service.invoker.AbstractInvoker.createFault(AbstractInvoker.java:170)
...
root cause
java.lang.NullPointerException
org.wso2.carbon.identity.openidconnect.AbstractUserInfoResponseBuilder.getRequestObject(AbstractUserInfoResponseBuilder.java:298)
...
This issue is already reported for IS 5.4.0.
https://github.com/wso2/product-is/issues/1953
This issue is fixed in the master branch of https://github.com/wso2-extensions/identity-inbound-auth-oauth.
When trying to access google translate api from an android application it gives the following error:
java.lang.RuntimeException: An error occurred while executing doInBackground()
....
Caused by: com.google.cloud.translate.TranslateException: Invalid Value
...
Caused by: com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
"code" : 400,
"errors" : [ {
"domain" : "global",
"message" : "Invalid Value",
"reason" : "invalid"
} ],
"message" : "Invalid Value"
The code inside doInBackground method() is:
Translate translate = TranslateOptions.newBuilder()
.setApiKey("myAPI_key").build().getService();
Translation translation = translate.translate(
params[0],
Translate.TranslateOption.sourceLanguage("en"),
Translate.TranslateOption.targetLanguage("al"));
return translation.getTranslatedText(); }
The string I pass is in english. Can anyone help me figuring out this error?
Thanks in advance.
Your problem is in the line:
Translate.TranslateOption.targetLanguage("al"));
al is not a correct code for any supported language.
You can check the complete list of supported languages in the Google APIs Explorer.
Got the following error while trying to create a folder in my app folder:
com.microsoft.graph.http.GraphFatalServiceException: [This is an unexpected error from Graph, please report this at https://github.com/microsoftgraph/msgraph-sdk-android/issues]
POST https://graph.microsoft.com/v1.0/me/drive/special/approot/children
SdkVersion : graph-android-v1.2.0
Authorization : bearer <REDACTED>
{"folder":{},"name":"gg"}
500 : Internal Server Error
Duration : 234.839
Cache-Control : private
X-Android-Sent-Millis : 1489454003081
Content-Type : application/json
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US","Slice":"SliceA","ScaleUnit":"000","Host":"AGSFE_IN_2","ADSiteName":"WST"}}
request-id : f25e8a83-5b40-493f-811c-7c9731790c9f
Date : Tue, 14 Mar 2017 01:13:37 GMT
Transfer-Encoding : chunked
X-Android-Response-Source : NETWORK 500
client-request-id : f25e8a83-5b40-493f-811c-7c9731790c9f
X-Android-Received-Millis : 1489454003395
{
"error": {
"code": "generalException",
"message": "An unspecified error has occurred.",
"innerError": {
"request-id": "f25e8a83-5b40-493f-811c-7c9731790c9f",
"date": "2017-03-14T01:13:37"
}
}
}
Per the app folder and the create folder documentation, the request should work given I have "Files.ReadWrite.AppFolder" permission scope.
I created the folder manually and tried to access its metadata and it failed similarly:
com.microsoft.graph.http.GraphFatalServiceException: [This is an unexpected error from Graph, please report this at https://github.com/microsoftgraph/msgraph-sdk-android/issues]
GET https://graph.microsoft.com/v1.0/me/drive/special/approot:/gg:
SdkVersion : graph-android-v1.2.0
Authorization : bearer <REDACTED>
500 : Internal Server Error
Duration : 199.4711
Cache-Control : private
X-Android-Sent-Millis : 1489455064558
Content-Type : application/json
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US","Slice":"SliceA","ScaleUnit":"003","Host":"AGSFE_IN_3","ADSiteName":"WST"}}
request-id : 660fad6b-491a-4876-98c5-9160c9f8715c
Date : Tue, 14 Mar 2017 01:31:19 GMT
Transfer-Encoding : chunked
X-Android-Response-Source : NETWORK 500
client-request-id : 660fad6b-491a-4876-98c5-9160c9f8715c
X-Android-Received-Millis : 1489455064872
{
"error": {
"code": "generalException",
"message": "An unspecified error has occurred.",
"innerError": {
"request-id": "660fad6b-491a-4876-98c5-9160c9f8715c",
"date": "2017-03-14T01:31:20"
}
}
}
There's a file in the app directory that I can access via its item id and get its contents without issues.
Any ideas what might be causing this issue?
The Files.ReadWrite.AppFolder scope is not currently supported, but cannot be removed for a list of reasons which are unfortunate. You will need to use a different scope, such as Files.ReadWrite, to gain access and create this folder.
Note that even after changing permissions requested by your app, you will need to reconsent to the app to get the new permissions. You can force that to happen to adding &prompt=consent to the end of the OAuth2 Authorization URL or you can remove consent to your app first from
I am writing a posting engine to run on Glassfish which posts to Twitter from a database queue.
I am using the Scribe Java API for doing this. I am having an issue with performing a signRequest from the OAuthService. I have a valid access token and have the tweet to send out - Below is my code for where the error is occuring.
String urlTweet = "https://api.twitter.com/1.1/statuses/update.json?status=Tweet To Post";
OAuthRequest tmpRequest = new OAuthRequest(Verb.POST, urlTweet);
oAuthService.signRequest(accessToken, tmpRequest); // THIS LINE THERE IS AN ERROR
response = tmpRequest.send();
However I am getting an error on the line shown above. Here is the stack trace for what I am getting - parts have been redacted for anonymity purposes.
org.scribe.exceptions.OAuthSignatureException: Error while signing string: POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fstatuses%2Fupdate.json&[redacted]
at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:36)
at org.scribe.oauth.OAuth10aServiceImpl.getSignature(OAuth10aServiceImpl.java:151)
at org.scribe.oauth.OAuth10aServiceImpl.addOAuthParams(OAuth10aServiceImpl.java:75)
at org.scribe.oauth.OAuth10aServiceImpl.signRequest(OAuth10aServiceImpl.java:126)
at [redacted].TWScribePost.postTwitter(TWScribePost.java:141)
at [redacted].Post.TWScribePost.post(TWScribePost.java:42)
at [redacted].Post.PostingEng$TWReadQueue.run(PostingEng.java:137)
at java.util.TimerThread.mainLoop(Unknown Source)
at java.util.TimerThread.run(Unknown Source)
Caused by: java.security.NoSuchAlgorithmException: Algorithm HmacSHA1 not available
at javax.crypto.Mac.getInstance(DashoA13*..)
at org.scribe.services.HMACSha1SignatureService.doSign(HMACSha1SignatureService.java:43)
at org.scribe.services.HMACSha1SignatureService.getSignature(HMACSha1SignatureService.java:32)
... 8 more
Try to use response = oAuthService.execute(tmpRequest); instead of response = tmpRequest.send();
In some google accounts when trying to get comments by :
req = Drive.comments().list(id);
req.execute();
I'm getting this exception :
{
"code" : 500,
"message" : null
}
at com.google.api.client.googleapis.json.GoogleJsonResponseException.from(GoogleJsonResponseException.java:145)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:113)
at com.google.api.client.googleapis.services.json.AbstractGoogleJsonClientRequest.newExceptionOnError(AbstractGoogleJsonClientRequest.java:40)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest$1.interceptResponse(AbstractGoogleClientRequest.java:312)
at com.google.api.client.http.HttpRequest.execute(HttpRequest.java:1049)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:410)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.executeUnparsed(AbstractGoogleClientRequest.java:343)
at com.google.api.client.googleapis.services.AbstractGoogleClientRequest.execute(AbstractGoogleClientRequest.java:460)
Any idea what could be a problem ?
HTTP 500 error means there is an internal server error, Google guys should fix it.