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

Curl error 3: URL rejected #656

Open
Nomad1108 opened this issue Jun 20, 2024 · 12 comments
Open

Curl error 3: URL rejected #656

Nomad1108 opened this issue Jun 20, 2024 · 12 comments

Comments

@Nomad1108
Copy link

Description

I get one error "Curl error 3: URL rejected: Error" per package when opening the NuGet for Unity window. Packages icons do not load, so best case scenario that's a cosmetic issue, but still annoying...

Capture d’écran 2024-06-20 à 13 05 09
  • NuGetForUnity Version: 4.1.1
  • Unity Version: Unity 2022.3.8f1
  • Operating System: MacOS
@Nomad1108
Copy link
Author

Nomad1108 commented Jun 20, 2024

I tried both plugin install methods: as GIT dependency via Package Manager and then via .unitypackage file but still got the issue.

I've also tried to change the placement to "Custom within Assets" but it did not solve the issue.

Note that I'm not using any proxy...

Capture d’écran 2024-06-20 à 13 09 01

@DilaverSerif
Copy link

same

@igor84
Copy link
Collaborator

igor84 commented Sep 10, 2024

I tried it on a Mac and I couldn't reproduce the issue. Can you open the icon URL in the browser (for example https://api.nuget.org/v3-flatcontainer/newtonsoft.json/13.0.3/icon)?

@DilaverSerif
Copy link

DilaverSerif commented Sep 11, 2024

its okey but i have still errors.
Ekran Resmi 2024-09-11 10 57 12

packages.config are changing but I cant use the packages because cant pull packages.
Ekran Resmi 2024-09-11 11 03 38

@owlvark
Copy link

owlvark commented Oct 3, 2024

I was also getting those Curl errors in the console on a fresh install. I went into the Preferences and checked "Use Verbose Logging" and restarted Unity and the Curl errors did not appear. Perhaps the default NuGet.config has problems?

For reference, after the logging setting change these lines were added to the config:

<?xml version="1.0" encoding="utf-8"?>
<packageSourceCredentials />
<add key="verbose" value="true" />

and <clear /> was removed.

Update: the errors are back.
The logs have this as the url:
Downloading image file:////var/folders/vj/5sqv1srj7ds8y8ztq... failed! Web error: Malformed URL, Handler error: .

@owlvark
Copy link

owlvark commented Oct 3, 2024

Ok, after further testing, I think it happens when there are spaces in the URL?

@JoC0de
Copy link
Collaborator

JoC0de commented Oct 3, 2024

so they are only for File-URLs? Or how can a URL have spaces normally they are encoded with %20. Do you have spaces inside one of the folders that contain your Unity project?

@owlvark
Copy link

owlvark commented Oct 4, 2024

Yes, it is a file and there are spaces; it is trying to open a URL like this:

file:////var/folders/vj/5sqv1srj7ds8y8ztqddggkww0000gn/T/Studio Name/Game Name/ER4xRB-z5RmCSiBeUlEktw

This results in the Curl error and a log message that says Web error: Malformed URL towards the end.
In my tests, when the spaces in that URL string are replaced with %20 the file loads as intended.

@Nomad1108
Copy link
Author

I can confirm that my "Company Name" in Player Settings is two words with a space between them, which would add at least one space to the URL.

@ndnomad
Copy link

ndnomad commented Dec 20, 2024

I am having this same error. I removed all the spaces in the offending paths, except one. Which is my Unity Projects folder, which hold my Project Name folders. Do I really have to rename all of my core Unity project folders to avoid this error?? I would hope this is a very simple bug for you to fix.

Edit: Thank you for this lovely package! I don't mean to come off as offensive, especially as you offer this package for free. I will leave my comment in the hopes of the bug getting fixed, but wanted to express gratitude to you as well.

@JoC0de
Copy link
Collaborator

JoC0de commented Dec 27, 2024

@ndnomad please check if the bug is resolved by the latest release.

@owlvark
Copy link

owlvark commented Dec 30, 2024

I tried out release v4.2.0 but the issue remains. Using new Uri unfortunately does not encode spaces.
If it is hard to reproduce, here is a test case (MacOS):

var url = "file:////var/folders/space test";
var request = UnityWebRequest.Get(url);
var downloadHandler = new DownloadHandlerTexture(false);
request.downloadHandler = downloadHandler;
var operation = request.SendWebRequest();

The above code throws the "Curl error 3" exception. If the space in the file URL is replaced with %20 it throws "Curl error 37: Couldn't open file" instead.

I think, if we want to avoid the controversy of Uri.EscapeUriString, in this case we could use url.Replace(" ", "%20").

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

No branches or pull requests

6 participants