buckneri / youtube-direct

Automatically exported from code.google.com/p/youtube-direct
0 stars 1 forks source link

Uploading video using unlinked Google account yields page with no text except "Error: OK" #86

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. I followed the "Getting Started" steps and video.
2. After deploying to Google App Engine, I attempted to upload a video while 
signed into YouTube with an unlinked Google account (one that did not have a 
YouTube username/channel).

What is the expected output? What do you see instead?

I expected to see a message that stated the account needed to be linked (to 
have a YouTube username/channel), and a link to allow that action to take place.

Instead, I received a page with title, "500 OK" and page text "Error: OK", with 
nothing else on the page.

Note I am able to proceed if I use a linked account (I get a page asking 
whether I want to upload a new video or an existing one, and selecting one of 
those options yields the appropriate form).

What version of the product are you using? On what operating system?

This happened both with the source from trunk and with the source from the 2.0 
release branch.  My local OS is Windows 7 (but note the error was appearing 
while deployed to the Google App Engine).  Browsers tested were IE 9 and FF 3.6.

Please provide any additional information below.

There are three different errors that I'm seeing.

First, there's the error page that's described above.  This contains almost no 
information.

Second, there's the server error log.  At the time I tested this, I found this 
in the log:

/AuthsubHandler?articleUrl=http%3A%2F%2Fbomgleecontest.appspot.com%2Fsample.html
&sessionId=ahBzfmJvbWdsZWVjb250ZXN0chILEgtVc2VyU2Vzc2lvbhiKJww&token=1/Tw99OJ27T
Ii-7V5IkyoOW7kkKDVR7wMHjYz8-suhImI 500 331ms 0kb Mozilla/5.0 (Windows; U; 
Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24 
See details 
66.55.206.74 - - [13/Dec/2011:13:08:54 -0800] "GET 
/AuthsubHandler?articleUrl=http%3A%2F%2Fbomgleecontest.appspot.com%2Fsample.html
&sessionId=ahBzfmJvbWdsZWVjb250ZXN0chILEgtVc2VyU2Vzc2lvbhiKJww&token=1/Tw99OJ27T
Ii-7V5IkyoOW7kkKDVR7wMHjYz8-suhImI HTTP/1.1" 500 220 
"http://www.youtube.com/auth_sub_request?scope=http%3A%2F%2Fgdata.youtube.com&se
ssion=1&next=http%3A%2F%2Fbomgleecontest.appspot.com%2FAuthsubHandler%3FarticleU
rl%3Dhttp%253A%252F%252Fbomgleecontest.appspot.com%252Fsample.html%26sessionId%3
DahBzfmJvbWdsZWVjb250ZXN0chILEgtVc2VyU2Vzc2lvbhiKJww&secure=0" "Mozilla/5.0 
(Windows; U; Windows NT 6.1; en-US; rv:1.9.2.24) Gecko/20111103 Firefox/3.6.24" 
"bomgleecontest.appspot.com" ms=331 cpu_ms=158 api_cpu_ms=65 cpm_usd=0.004689 
instance=00c61b117c30a2a5b7d6b6fbf55a9270a6ca49W 2011-12-13 16:08:54.607 
com.google.ytd.embed.AuthSubHandler doGet: 
com.google.gdata.util.AuthenticationException: OK
<HTML>
<HEAD>
<TITLE>NoLinkedYouTubeAccount</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>NoLinkedYouTubeAccount</H1>
<H2>Error 401</H2>
</BODY>
</HTML>

    at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:596)
    at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
    at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:550)
    at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
    at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
    at com.google.gdata.client.Service.getEntry(Service.java:1319)
    at com.google.gdata.client.GoogleService.getEntry(GoogleService.java:567)
    at com.google.gdata.client.Service.getEntry(Service.java:1245)
    at com.google.ytd.youtube.YouTubeApiHelper.getCurrentUsername(YouTubeApiHelper.java:156)
    at com.google.ytd.embed.AuthSubHandler.doGet(AuthSubHandler.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at com.google.inject.servlet.ServletDefinition.doService(ServletDefinition.java:216)
    at com.google.inject.servlet.ServletDefinition.service(ServletDefinition.java:141)
    at com.google.inject.servlet.ManagedServletPipeline.service(ManagedServletPipeline.java:93)
    at com.google.inject.servlet.FilterChainInvocation.doFilter(FilterChainInvocation.java:63)
    at com.google.inject.servlet.ManagedFilterPipeline.dispatch(ManagedFilterPipeline.java:122)
    at com.google.inject.servlet.GuiceFilter.doFilter(GuiceFilter.java:110)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:102)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
    at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
    at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
    at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
    at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
    at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
    at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
    at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:249)
    at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
    at org.mortbay.jetty.Server.handle(Server.java:326)
    at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
    at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
    at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
    at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
    at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:135)
    at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:422)
    at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:449)
    at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:455)
    at com.google.tracing.TraceContext.runInContext(TraceContext.java:695)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:333)
    at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:325)
    at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:453)
    at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
    at java.lang.Thread.run(Thread.java:679)

I'm not sure why that error page (with title "NoLinkedYouTubeAccount") isn't 
being displayed to the user.

Third, there's the source code.  Looking at the code for AuthSubHandler, it 
sure seems like we should be seeing "Unable to retrieve a YouTube username for 
the authenticated user" somewhere... but we're not, either in the logs or on 
the page.

On the page that eventually gets displayed to the user, where's that "500" 
coming from?

Why doesn't the relevant error listed in the code show up in the server log?  
For that matter, why doesn't the error that does appear in the server log show 
up on the user's page?

Original issue reported on code.google.com by mbmerr...@gmail.com on 13 Dec 2011 at 9:36

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Some additional information:

AuthSubHelper.doGet() calls YouTubeApiHelper.getCurrentUsername().  When you're 
logging in with an unlinked Google account, getCurrentUsername() throws an 
uncaught AuthenticationException with the message "OK".  A fairly simple fix is 
to add another catch clause to the try-catch block in 
YouTubeApiHandler.getCurrentUsername(); just log the message and continue 
processing.  The rest of AuthSubHelper.doGet() will function properly, 
detecting the null youTubeName and throwing a more informative exception.

Unfortunately, the front end doesn't seem designed to handle that informative 
exception very well; you end up with a page that displays:

{"error":"400: Unable to retrieve a YouTube username for the authenticated 
user."}

I haven't looked into what would be necessary to properly handle that case on 
the front end.

Original comment by mbmerr...@gmail.com on 15 Dec 2011 at 2:27

GoogleCodeExporter commented 8 years ago
The strange thing is that when logging in via AuthSub to an unlinked YouTube 
account, you're *supposed* to be forced to link the YouTube account to a Google 
Account before you can proceed. I was pretty sure that's the case, but it 
sounds like it's not.

I'll look into that first, since uploading any videos into an unlinked account 
is a non-starter anyway.

Original comment by je...@google.com on 28 Dec 2011 at 8:48

GoogleCodeExporter commented 8 years ago
Hi 

I am facing same issue with my youtube direct API.
Refer the attached image with this post.

Thanks
Sunil G.

Original comment by ytdirect...@gmail.com on 20 Feb 2012 at 11:59

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by api.je...@gmail.com on 22 Feb 2012 at 3:20

GoogleCodeExporter commented 8 years ago
The same Error here... any update ??
any solution ??

Original comment by dev.denu...@gmail.com on 5 Apr 2012 at 10:46