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

Cannot add a certain bookmark (ReadTimeoutError) #696

Closed
jarun opened this issue Sep 24, 2023 · 3 comments
Closed

Cannot add a certain bookmark (ReadTimeoutError) #696

jarun opened this issue Sep 24, 2023 · 3 comments

Comments

@jarun
Copy link
Owner

jarun commented Sep 24, 2023

Adding bookmarks from embedded.com fails all the time (tested with master):

$ buku -g -a www.embedded.com/flash-101-nand-flash-vs-nor-flash/
[DEBUG] buku v4.8
[DEBUG] Python v3.10.12
[DEBUG] netloc: www.embedded.com
[DEBUG] Starting new HTTP connection (1): www.embedded.com:80
[DEBUG] Incremented Retry for (url='/flash-101-nand-flash-vs-nor-flash/'): Retry(total=9, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=9, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='www.embedded.com', port=80): Read timed out. (read timeout=15)")': /flash-101-nand-flash-vs-nor-flash/
[DEBUG] Starting new HTTP connection (2): www.embedded.com:80
[DEBUG] Incremented Retry for (url='/flash-101-nand-flash-vs-nor-flash/'): Retry(total=8, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=8, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='www.embedded.com', port=80): Read timed out. (read timeout=15)")': /flash-101-nand-flash-vs-nor-flash/
[DEBUG] Starting new HTTP connection (3): www.embedded.com:80
[DEBUG] Incremented Retry for (url='/flash-101-nand-flash-vs-nor-flash/'): Retry(total=7, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=7, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPConnectionPool(host='www.embedded.com', port=80): Read timed out. (read timeout=15)")': /flash-101-nand-flash-vs-nor-flash/
[DEBUG] Starting new HTTP connection (4): www.embedded.com:80
^C
Interrupted.
$ buku -g -a https://www.embedded.com/flash-101-the-nand-flash-electrical-interface/
[DEBUG] buku v4.8
[DEBUG] Python v3.10.12
[DEBUG] netloc: www.embedded.com
[DEBUG] Starting new HTTPS connection (1): www.embedded.com:443
[DEBUG] Incremented Retry for (url='/flash-101-the-nand-flash-electrical-interface/'): Retry(total=9, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=9, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.embedded.com', port=443): Read timed out. (read timeout=15)")': /flash-101-the-nand-flash-electrical-interface/
[DEBUG] Starting new HTTPS connection (2): www.embedded.com:443
[DEBUG] Incremented Retry for (url='/flash-101-the-nand-flash-electrical-interface/'): Retry(total=8, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=8, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.embedded.com', port=443): Read timed out. (read timeout=15)")': /flash-101-the-nand-flash-electrical-interface/
[DEBUG] Starting new HTTPS connection (3): www.embedded.com:443
[DEBUG] Incremented Retry for (url='/flash-101-the-nand-flash-electrical-interface/'): Retry(total=7, connect=None, read=None, redirect=10, status=None)
[WARNING] Retrying (Retry(total=7, connect=None, read=None, redirect=10, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='www.embedded.com', port=443): Read timed out. (read timeout=15)")': /flash-101-the-nand-flash-electrical-interface/
[DEBUG] Starting new HTTPS connection (4): www.embedded.com:443
^C
Interrupted.

@LeXofLeviafan check this out if you have some time.

@LeXofLeviafan
Copy link
Collaborator

The site itself has connection issues:

  • Firefox: may refuse to load with transfer status NS_ERROR_NET_INTERRUPT (especially when accessing via VPN)
  • Chrome: completely inaccessible (for me) with status ERR_HTTP2_PROTOCOL_ERROR
  • Vivaldi: same result as Chrome but only when the site doesn't load in Firefox as well (…for some reason)
  • wget: permanently hangs after printing HTTP request sent, awaiting response...
  • curl: halts immediately with an error message saying (92) HTTP/2 stream 1 was not closed cleanly: INTERNAL_ERROR (err 2)

My best guess is that they have rather quirky security setup on their server.

I'd suggest implementing fallback behaviour for cases when the URL cannot be accessed (like prompting the user for bookmark title instead, or defaulting to the URL/empty string as the title). Also maybe don't try to load the page in the first place when both --title and --comment are supplied (and/or have an option to disable automatic fetch altogether, e.g. --offline); at the moment even supplying --immutable 1 doesn't prevent Buku from trying to access the URL passed to --add.

@jarun
Copy link
Owner Author

jarun commented Sep 24, 2023

I agree, an offline method is the best possible option.

@jarun jarun changed the title Cannot add a certain API (ReadTimeoutError) Cannot add a certain bookmeark (ReadTimeoutError) Oct 17, 2023
@jarun jarun changed the title Cannot add a certain bookmeark (ReadTimeoutError) Cannot add a certain bookmark (ReadTimeoutError) Oct 17, 2023
@jarun
Copy link
Owner Author

jarun commented Jan 1, 2024

Implemented offline bookmark addition support at commit 0a526f0.

@jarun jarun closed this as completed Jan 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Feb 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants