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

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

Closed
GoogleCodeExporter opened this issue Aug 11, 2015 · 6 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

much appreciated.

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

@GoogleCodeExporter
Copy link
Author

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

  • Changed state: Fixed

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

No branches or pull requests

1 participant