After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 763038 - souphttpsrc: add http error code to element error messages
souphttpsrc: add http error code to element error messages
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Linux
: Normal enhancement
: 1.9.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on: 756806
Blocks: 753751
 
 
Reported: 2016-03-03 11:49 UTC by Vincent Penquerc'h
Modified: 2016-07-25 10:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
include http error code in error message (3.92 KB, patch)
2016-03-03 11:50 UTC, Vincent Penquerc'h
none Details | Review
include http error code in error message (3.92 KB, patch)
2016-03-03 13:09 UTC, Vincent Penquerc'h
none Details | Review
include http error code in error message (3.90 KB, patch)
2016-07-18 15:27 UTC, Vincent Penquerc'h
none Details | Review
include http status code in error message (3.91 KB, patch)
2016-07-22 13:52 UTC, Vincent Penquerc'h
none Details | Review
add body when available (6.27 KB, patch)
2016-07-22 13:53 UTC, Vincent Penquerc'h
rejected Details | Review
include http status code in error message (4.00 KB, patch)
2016-07-25 08:52 UTC, Vincent Penquerc'h
none Details | Review
include http status code in error message (4.30 KB, patch)
2016-07-25 09:14 UTC, Vincent Penquerc'h
none Details | Review
include http status code in error message (4.40 KB, patch)
2016-07-25 09:50 UTC, Vincent Penquerc'h
committed Details | Review

Description Vincent Penquerc'h 2016-03-03 11:49:19 UTC
+++ This bug was initially created as a clone of Bug #756806 +++

Add http error code to souphttpsrc element error messages.
Comment 1 Vincent Penquerc'h 2016-03-03 11:50:32 UTC
Created attachment 322965 [details] [review]
include http error code in error message
Comment 2 Vincent Penquerc'h 2016-03-03 13:09:47 UTC
Created attachment 322974 [details] [review]
include http error code in error message

HTTP error code is now unsigned.
Comment 3 Vincent Penquerc'h 2016-07-18 15:27:48 UTC
Created attachment 331734 [details] [review]
include http error code in error message

Uses the latest patch from https://bugzilla.gnome.org/show_bug.cgi?id=756806
Comment 4 Sebastian Dröge (slomo) 2016-07-22 11:32:38 UTC
Review of attachment 331734 [details] [review]:

::: ext/soup/gstsouphttpsrc.c
@@ +1228,3 @@
         ("Server does not accept Range HTTP header, URL: %s, Redirect to: %s",
+            src->location, GST_STR_NULL (src->redirection_uri)),
+        ("http-error-code", G_TYPE_UINT, msg->status_code, NULL));

It's an HTTP status code, not error code :)

It might also be a good idea to add the message body here, it can contain useful information.
Comment 5 Vincent Penquerc'h 2016-07-22 13:52:29 UTC
Created attachment 331999 [details] [review]
include http status code in error message
Comment 6 Vincent Penquerc'h 2016-07-22 13:53:09 UTC
Created attachment 332000 [details] [review]
add body when available
Comment 7 Sebastian Dröge (slomo) 2016-07-25 07:38:26 UTC
Comment on attachment 331999 [details] [review]
include http status code in error message

Might make sense to also add the redirection URL to the details though
Comment 8 Sebastian Dröge (slomo) 2016-07-25 07:39:28 UTC
Comment on attachment 332000 [details] [review]
add body when available

On a second thought this might be not a good idea at all... the body might be huge, and especially when printed in debug logs, error messages, etc it might kill applications :)
Comment 9 Vincent Penquerc'h 2016-07-25 08:52:36 UTC
Created attachment 332081 [details] [review]
include http status code in error message

With http-redirect-uri too.
Comment 10 Sebastian Dröge (slomo) 2016-07-25 08:56:59 UTC
Review of attachment 332081 [details] [review]:

::: ext/soup/gstsouphttpsrc.c
@@ +1228,3 @@
         ("Server does not accept Range HTTP header, URL: %s, Redirect to: %s",
+            src->location, GST_STR_NULL (src->redirection_uri)),
+        ("http-status-code", G_TYPE_UINT, msg->status_code, NULL));

This and the others not using the SOUP_HTTP_SRC_ERROR() macro are not adding the redirect-uri
Comment 11 Vincent Penquerc'h 2016-07-25 09:14:37 UTC
Created attachment 332087 [details] [review]
include http status code in error message
Comment 12 Sebastian Dröge (slomo) 2016-07-25 09:29:20 UTC
Review of attachment 332087 [details] [review]:

::: ext/soup/gstsouphttpsrc.c
@@ +1228,3 @@
         ("Server does not accept Range HTTP header, URL: %s, Redirect to: %s",
+            src->location, GST_STR_NULL (src->redirection_uri)),
+        ("http-status-code", G_TYPE_UINT, msg->status_code, NULL));

redirection uri? please also double-check if you really got all places where the status code should be added
Comment 13 Vincent Penquerc'h 2016-07-25 09:35:30 UTC
Well, this error is a seek error, not a redirect one. Not sure why it's also including a redirection uri...
Comment 14 Vincent Penquerc'h 2016-07-25 09:50:13 UTC
Created attachment 332093 [details] [review]
include http status code in error message

Added. http-status-code is present in all relevant calls to GST_ELEMENT_ERROR*. The ones it's not in are things like no URL given, or library errors.
Comment 15 Sebastian Dröge (slomo) 2016-07-25 09:51:33 UTC
A seek is just another HTTP request :) You could e.g. seek before anything else and then the first request is a Range request that might cause a redirect or two to happen and then something fails.
Comment 16 Vincent Penquerc'h 2016-07-25 10:18:29 UTC
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Thu Mar 3 11:35:06 2016 +0000

    souphttpsrc: include http-status-code in error message details
    
    https://bugzilla.gnome.org/show_bug.cgi?id=763038