samk17 / gtm-oauth2

Automatically exported from code.google.com/p/gtm-oauth2
0 stars 0 forks source link

assertion failure at GTMHTTPUploadFetcher.m:402 when using account with no YouTube channel #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. attempt to upload a video to YouTube on iOS
2.
3.

What is the expected output? What do you see instead?
assertion failure at GTMHTTPUploadFetcher.m:402
Apparently as a result of using a google account with no YouTube account 
channel.

What version of the product are you using? On what operating system?
latest as of dec 3 2013

Please provide any additional information below.

Original issue reported on code.google.com by nish...@nagisa-inc.jp on 4 Dec 2013 at 9:46

GoogleCodeExporter commented 9 years ago
Can you provide an http log?

https://code.google.com/p/google-api-objectivec-client/wiki/Introduction#Logging
_HTTP_Server_Traffic

Original comment by grobb...@google.com on 4 Dec 2013 at 6:21

GoogleCodeExporter commented 9 years ago
Sure, here's the log:

youtube.videos.insert

2013-12-04 09:04:10 +0000
Request: POST 
https://www.googleapis.com/upload/rpc?uploadType=resumable&prettyPrint=false
Request headers:
  Accept: application/json-rpc
  Authorization: Bearer _snip_
  Cache-Control: no-cache
  Content-Type: application/json-rpc; charset=utf-8
  User-Agent: jp.nagisa-inc.FOOBAR/1.0 google-api-objc-client/2.0 iPhone/7.0.2 (gzip)
  X-Upload-Content-Length: 9680229
  X-Upload-Content-Type: video/x-m4v

Request body: (383 bytes)
{
  "method" : "youtube.videos.insert",
  "id" : "gtl_1",
  "jsonrpc" : "2.0",
  "params" : {
    "part" : "snippet,status",
    "resource" : {
      "status" : {
        "privacyStatus" : "public"
      },
      "snippet" : {
        "description" : "FOOBAR",
        "title" : "FOOBAR",
        "tags" : [
          "FOOBAR"
        ]
      }
    }
  },
  "apiVersion" : "v3"
}

Response: status 200
Response headers:
  Alternate-Protocol: 443:quic
  Cache-Control: no-cache, no-store, max-age=0, must-revalidate
  Content-Length: 209
  Content-Type: application/json
  Date: Wed, 04 Dec 2013 09:04:11 GMT
  Expires: Fri, 01 Jan 1990 00:00:00 GMT
  Pragma: no-cache
  Server: HTTP Upload Server Built on Nov 15 2013 16:02:54 (1384560174)

Response body: (209 bytes)
{
  "id" : "gtl_1",
  "error" : {
    "message" : "Unauthorized",
    "code" : -32602,
    "data" : [
      {
        "domain" : "youtube.header",
        "reason" : "youtubeSignupRequired",
        "locationType" : "header",
        "location" : "Authorization",
        "message" : "Unauthorized"
      }
    ]
  }
}
-----------------------------------------------------------

Original comment by nish...@nagisa-inc.jp on 5 Dec 2013 at 12:59

GoogleCodeExporter commented 9 years ago
I commented out the two assertions so it returns an error instead of crash. 
(just as it would in non-debug build if I understand correctly)

Original comment by nish...@nagisa-inc.jp on 5 Dec 2013 at 1:01

GoogleCodeExporter commented 9 years ago
The fetcher was written expecting errors as http status codes, but the YouTube 
API is now retuning them as JSON. I'll modify the library to not assert there, 
effectively similar to what you've done.

Incidentally, this issue tracker is intended for the OAuth 2 library, not for 
the GTL library.

Original comment by grobb...@google.com on 5 Dec 2013 at 1:37

GoogleCodeExporter commented 9 years ago
much appreciated.

Original comment by nish...@nagisa-inc.jp on 5 Dec 2013 at 1:44

GoogleCodeExporter commented 9 years ago
This should be resolved in the top-of-trunk library. Please update your library 
sources.

https://code.google.com/p/gtm-http-fetcher/source/detail?r=134

Thank you for reporting the issue.

Original comment by grobb...@google.com on 6 Dec 2013 at 11:33