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 711267 - unhelpful error message "Invalid URI"
unhelpful error message "Invalid URI"
Status: RESOLVED FIXED
Product: gnome-boxes
Classification: Applications
Component: general
unspecified
Other Linux
: Normal normal
: 3.22
Assigned To: GNOME Boxes maintainer(s)
GNOME Boxes maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-11-01 18:08 UTC by Matthias Clasen
Modified: 2016-03-31 13:22 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Better error message for the current bug. (690 bytes, patch)
2014-10-03 03:44 UTC, Chitra Singh
none Details | Review
error_msg_changed (690 bytes, patch)
2014-10-03 03:55 UTC, Chitra Singh
none Details | Review

Description Matthias Clasen 2013-11-01 18:08:12 UTC
I didn't read the small print and entered a http uri point at some boot.iso into the url field. That yielded a notification saying: Invalid URI

That is technically incorrect - the uri is perfectly valid, you just don't handle it. I think there are two things that could be done here:

1) download the iso and treat it like any other iso (that would be nicely helpful)
2) explain that the uri looks like a download uri, and that I have to download the iso manually, at which point it will appear in the list

I then read the small print, and tried to enter the uri in the file chooser location entry, but that gave me an even worse error message: empty location
Comment 1 Chitra Singh 2014-10-03 03:44:02 UTC
Created attachment 287636 [details] [review]
Better error message for the current bug.
Comment 2 Chitra Singh 2014-10-03 03:55:08 UTC
Created attachment 287637 [details] [review]
error_msg_changed

Hi
I took wrong diff in the above patch. Ignore that one.
Comment 3 Lasse Schuirmann 2014-10-03 13:46:29 UTC
Hi!

Welcome to the community and thanks for submitting this patch!

Actually Boxes supports ISO downloading since 3.14. (I must know it, I implemented it ;))

I'm not sure a fix is still needed for this bug:
$ git grep -B3  Invalid\ URI src/*.vala
src/spice-display.vala-    var uri = Xml.URI.parse (uri_as_text);
src/spice-display.vala-
src/spice-display.vala-    if (uri == null)
src/spice-display.vala:        throw new Boxes.Error.INVALID (_("Invalid URI"));
--
src/wizard.vala-    private void prepare_for_uri (string uri_as_text) throws Boxes.Error {
src/wizard.vala-        var uri = Xml.URI.parse (uri_as_text);
src/wizard.vala-        if (uri == null || uri.scheme == null)
src/wizard.vala:            throw new Boxes.Error.INVALID (_("Invalid URI"));
--
src/wizard.vala-            var basename = file.get_basename ();
src/wizard.vala-
src/wizard.vala-            if (basename == null || basename == "" || basename == "/")
src/wizard.vala:                throw new Boxes.Error.INVALID (_("Invalid URI"));

Seems that for every condition, where this message is shown its really an invalid URI, except maybe the last one which could be a valid URI that points to a directory on the server (see http://valadoc.org/#!api=gio-2.0/GLib.File.get_basename - great resource by the way!). A better message for this one could be "Invalid or unsupported URI" or so IMO.

In general when you're trying to fix bugs it is a good idea to reproduce them first to see if they are still valid and "get a feeling for the bug". You probably also want to test it again to test if your fix works - even if its a simple one.

A thing about the commit messages. You might want to look at `git log` how other people do them. We also have a wiki page with a checklist for this:
https://wiki.gnome.org/Git/CommitMessages

Feel free to submit another patch :)
Comment 4 Zeeshan Ali 2014-10-05 16:45:05 UTC
(In reply to comment #3)
> Hi!
> 
> Welcome to the community and thanks for submitting this patch!
> 
> Actually Boxes supports ISO downloading since 3.14. (I must know it, I
> implemented it ;))
> 
> I'm not sure a fix is still needed for this bug:

While the original specific issue might not need fixing, I think we still need better handling of invalid URIs:

1. We shouldn't popup annoying notifications for this but rather provide all feedback in the labels below the entry.

2. Not enable 'continue' until a useable URI is entered. This is covered by bug#686348, which Chitra is also looking into.

Thanks for the information and welcome message. :)
Comment 5 Zeeshan Ali 2014-10-15 23:22:13 UTC
I think bug#679890 should also be covered with this. Marking it as duplicate.
Comment 6 Zeeshan Ali 2014-10-15 23:22:31 UTC
*** Bug 679890 has been marked as a duplicate of this bug. ***
Comment 7 Zeeshan Ali 2014-10-20 18:20:22 UTC
*** Bug 733249 has been marked as a duplicate of this bug. ***
Comment 8 Zeeshan Ali 2015-02-17 15:28:33 UTC
Well, we ended up replacing the 'live feedback about entered URL' with static description and examples of URL. Also we expect users to typically copy&paste URLs and also provide completion in the entry based on media URLs from libosinfo.