PromyLOPh / pianobar

Console-based pandora.com player
http://6xq.net/pianobar/
Other
1.74k stars 325 forks source link

Bug : Network error: Unknown HTTP status code. (2011.01.24) #100

Closed ovacikar closed 13 years ago

ovacikar commented 13 years ago

Hello

I cannot login using 2011.01.24 build. Getting Network error: Unknown HTTP status code

Also compiled 2010.11.06 side by side and it works. Using Debian lenny.

arda@wyse:~/pianobar-2011.01.24$ sudo make install install -d //usr/local/bin/ install -m755 pianobar //usr/local/bin/ install -d //usr/local/share/man/man1/ install -m644 contrib/pianobar.1 //usr/local/share/man/man1/ arda@wyse:~/pianobar-2011.01.24$ /usr/local/bin/pianobar Welcome to pianobar (2011.01.24)! Press ? for a list of commands. [?] Username: -removed- [?] Password: (i) Login... Network error: Unknown HTTP status code.

arda@wyse:~$ cd pianobar-2010.11.06/ arda@wyse:~/pianobar-2010.11.06$ ./pianobar Welcome to pianobar (2010.11.06)! Press ? for a list of commands. [?] Username:-removed- [?] Password: (i) Login... Ok. (i) Get stations... Ok. 0) Alessandro Safina Radio 1) q Glee Cast Radio 2) q I See You (Theme From Avatar) Radio 3) q Juanes Radio 4) q La Quinta Estacion Radio 5) q Lady Gaga Radio 6) q Nelly Furtado Radio 7) Q ovacikar's QuickMix [?] Select station: arda@wyse:~/pianobar-2010.11.06$

I did an strace and seeing a 400 bad request response from pandora:

connect(3, {sa_family=AF_INET, sin_port=htons(80), sin_addr=inet_addr("208.85.40 .50")}, 16) = -1 EINPROGRESS (Operation now in progress) poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) getsockopt(3, SOL_SOCKET, SO_ERROR, [0], [4]) = 0 poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) write(3, "POST /radio/xmlrpc/v29?rid=\340\204m\267&m"..., 70) = 70 poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) write(3, "Host: www.pandora.com\r\nUser-Agent"..., 48) = 48 poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) write(3, "Content-Length: 5\r\n"..., 19) = 19 poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) write(3, "Content-Type: text/xml\r\n"..., 24) = 24 poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) write(3, "\r\n"..., 2) = 2 poll([{fd=3, events=POLLOUT}], 1, 30000) = 1 ([{fd=3, revents=POLLOUT}]) write(3, " R\354\t\2"..., 5) = 5 poll([{fd=3, events=POLLIN}], 1, 30000) = 1 ([{fd=3, revents=POLLIN}]) read(3, "HTTP/1.1 400 Bad Request\r\nDate: S"..., 10239) = 392

PromyLOPh commented 13 years ago

write(3, "POST /radio/xmlrpc/v29?rid=\340\204m\267&m"..., 70) = 70

The routeid looks strange. Can you compile the current master with "make debug" and run it in gdb please?

break main.c:359
run
print app.ph.routeId

A network traffic dump would do it too (just the http headers, not the post content).

ovacikar commented 13 years ago

weird, when i compile 2011.01.24 with debug it works. make clean, compile without debug and it fails.

You can close this , since there is a workaround and I am using oldstable release of debian

tried the same on master and it behaved the same

PromyLOPh commented 13 years ago

A heisenbug. Either your compiler is broken -- we've already had that a few times in the past -- or pianobar is relying on undefined behaviour somewhere. Unless you can prove that it's a bug in pianobar I'm going to assume it's the compiler's fault and close this issue as "not a bug".

balcy commented 13 years ago

I have the same error message (Network error: Unknown HTTP status code.) if I use gcc-4 on cygwin, with gcc-3 I do not have problems.

(The only thing was that first I did not have c99 support, so I put the variable declarations in front of the for loops)

great app by the way !! Hope it will be there for a long time. (Even makes Pandora possible on my PowerPC with Linux, that has no Flash support)

PromyLOPh commented 13 years ago

I can't do anything about it. Disabling compiler optimization fixes the issue for me, so it's probably a compiler bug. See my comment above.

balcy commented 13 years ago

yeah thanks... it was just for other cygwin users that might have problems compiling it, that they could give gcc-3 a try instead of gcc-4. (e.g. export cc=/usr/bin/gcc-3)