alphapapa / org-web-tools

View, capture, and archive Web pages in Org-mode
GNU General Public License v3.0
647 stars 33 forks source link

Curl error #62

Closed OrionRandD closed 11 months ago

OrionRandD commented 1 year ago

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 commented 1 year ago

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

askdkc commented 11 months ago

@alphapapa

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

askdkc commented 11 months ago

@alphapapa

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

So I guess this is only happening on macOS.

askdkc commented 11 months ago

@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 commented 11 months ago

@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 commented 11 months ago

@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 commented 11 months ago

@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 commented 11 months ago

@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 commented 11 months ago

@OrionRandD

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

alphapapa commented 11 months ago

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 commented 11 months ago

@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 commented 11 months ago

@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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

@alphapapa

Debian's misbehavior was unrelated to the clipboard bug, unlike macOS or Windows. So I've updated the title of https://github.com/alphapapa/org-web-tools/pull/66 for clarification purposes.

Should I open a new issue to address the clipboard bug on macOS and Windows for this PR https://github.com/alphapapa/org-web-tools/pull/66?

alphapapa commented 11 months ago

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