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 #62

Closed
OrionRandD opened this issue Nov 3, 2023 · 16 comments
Closed

Curl error #62

OrionRandD opened this issue Nov 3, 2023 · 16 comments

Comments

@OrionRandD
Copy link

After issuing any "M-x org-web-tools-*" commands, I am getting this error:

plz: plz: Curl error: "Curl error", #s(plz-error (6 . "Couldn't resolve host. The given remote host was not resolved.") nil nil)

@alphapapa
Copy link
Owner

Well, the error means what it says: that curl could not resolve the hostname in the URL you are trying to act on.

@askdkc
Copy link
Contributor

askdkc commented Dec 9, 2023

@alphapapa

I'm having the same issue on my Mac. Wonder why.

@askdkc
Copy link
Contributor

askdkc commented Dec 9, 2023

@alphapapa

I tried this package on my Debian laptop, and it works perfectly.

So I guess this is only happening on macOS.

@askdkc
Copy link
Contributor

askdkc commented Dec 9, 2023

@alphapapa

I found the solution for this issue. It needs to use pbpaste in order to properly paste the url from clipboard.
I added if statement to check if the user environment is macOS or not to determine to use pbpaste or gui-get-selection 'CLIPBOARD.

Hope this will help.

@alphapapa
Copy link
Owner

@askdkc This issue was filed without any reference to MacOS, and the error message is simply that the remote host can't be resolved. While that could be caused by corrupted input, the error message means simply what it says, and that could happen for any number of reasons. If you are having a specific problem on MacOS, it should be handled separately from this issue.

@askdkc
Copy link
Contributor

askdkc commented Dec 10, 2023

@alphapapa You're right! I have Mac and Debian Laptop and it only happens on my Mac, so that I assumed that @OrionRandD also running macOS.

@OrionRandD Are you using Linux or macOS or Windows? If you gives us which environment you are using, that would be very helpful!

@alphapapa
Copy link
Owner

@askdkc It seems to me that the first step we should take is to have --get-first-url signal an error if no URL is found; that would prevent other functions from calling Curl with an empty URL argument and move the error closer to the problem.

@OrionRandD
Copy link
Author

@alphapapa You're right! I have Mac and Debian Laptop and it only happens on my Mac, so that I assumed that @OrionRandD also running macOS.

@OrionRandD Are you using Linux or macOS or Windows? If you gives us which environment you are using, that would be very helpful!

Debian-sid

GNU Emacs 29.1 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.38, cairo version 1.16.0) of 2023-08-30, modified by Debian

curl 8.5.0 (x86_64-pc-linux-gnu) libcurl/8.5.0 OpenSSL/3.1.4 zlib/1.3 brotli/1.1.0 zstd/1.5.5 libidn2/2.3.4 libpsl/0.21.2 (+libidn2/2.3.4) libssh2/1.11.0 nghttp2/1.58.0 librtmp/2.3 OpenLDAP/2.5.13
Release-Date: 2023-12-06, security patched: 8.5.0-1

@askdkc
Copy link
Contributor

askdkc commented Dec 10, 2023

@OrionRandD

Interesting👀 Mine is Bookworm and does't have the issue.
Hopefully my PR will fix your issue too.

@alphapapa
Copy link
Owner

Given that @OrionRandD does not use Mac or Windows, the problem he reported is unlikely to be the same as the one you reported.

@OrionRandD If you are still having this problem, you will need to provide more information, like a step-by-step guide to reproduce the problem. Otherwise there's nothing I can do.

@askdkc
Copy link
Contributor

askdkc commented Dec 12, 2023

@alphapapa
@OrionRandD

To test if it works on Debian sid or not, I did:

  1. Installed Bookworm on VM and upgrade it to sid.
  2. I install Emacs using sudo apt install emacs.
  3. Open Emacs, add melpa to package source, install your package using M-x package-list-packages and select org-web-tools to install.
  4. Open scratch buffer, copied url of this GitHub repo, and M-x org-tools-insert-link-for-url

The Result:

image

So, I guess normal installation of org-web-tools on Debian sid just works.

@OrionRandD
Copy link
Author

@alphapapa @OrionRandD

To test if it works on Debian sid or not, I did:

1. Installed Bookworm on VM and upgrade it to sid.

2. I install Emacs using `sudo apt install emacs`.

3. Open Emacs, add melpa to package source, install your package using `M-x package-list-packages` and select `org-web-tools` to install.

4. Open scratch buffer, copied url of this GitHub repo, and `M-x org-tools-insert-link-for-url`

The Result:

image

So, I guess normal installation of org-web-tools on Debian sid just works.

Mine always come with this curl error in the scratch buffer:

https://github.com/alphapapa/org-web-tools/issues/62#issuecomment-1851351760[[https://github.com/alphapapa/org-web-tools/issues/62#issuecomment-1851351760][Curl error · Issue #62 · alphapapa/org-web-tools · GitHub]]

In Emacs Normal Estate and Doom-Emacs :(

Perhaps the error is solely related with curl...

@OrionRandD
Copy link
Author

Hum....
I have tested everything again on an org file and org-web-tools is now working in Emacs-NE and Doom!
Although the warning still show up in the scratch buffer...
I think you can close the issue...
If I face any other issues, I will come back here...
Thx for the persistence and great help!

@alphapapa
Copy link
Owner

Sometimes I notice that curl's DNS request times out, and if I just run the command again, it works. Likely what's happening here.

@askdkc
Copy link
Contributor

askdkc commented Dec 13, 2023

@alphapapa

Debian's misbehavior was unrelated to the clipboard bug, unlike macOS or Windows.
So I've updated the title of #66 for clarification purposes.

Should I open a new issue to address the clipboard bug on macOS and Windows for this PR #66?

@alphapapa
Copy link
Owner

I think #66 can stand alone without an accompanying issue. Thanks.

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

3 participants