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

Shortcode tests unavailable (network error) #1

Closed
queensferryme opened this issue Feb 1, 2020 · 4 comments
Closed

Shortcode tests unavailable (network error) #1

queensferryme opened this issue Feb 1, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@queensferryme
Copy link
Owner

I import the official hugo example site (https://github.com/gohugoio/hugoBasicExample) for testing this theme. However, content/post/rich-content.md result in an issue, presumably related to networking.

This file contains hugo shortcodes for instagram, twitter etc., and these services are sofar unaccessible from China mainland.

queensferry at queensferry-windows in /mnt/d/Code/hugo-theme-verse on features/site!
 ± hugo server --config="exampleSite/config.toml" --disableFastRender

Building sites … WARN 2020/02/01 19:32:16 found no layout file for "HTML" for "taxonomyTerm": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/02/01 19:32:16 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2020/02/01 19:32:16 found no layout file for "HTML" for "taxonomy": You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
ERROR 2020/02/01 19:32:17 Failed to get JSON resource "https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInzyFAe/&maxwidth=640&omitscript=true": Get https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BGvuInzyFAe/&maxwidth=640&omitscript=true: EOF
ERROR 2020/02/01 19:32:38 Failed to get JSON resource "https://api.twitter.com/1/statuses/oembed.json?id=1085870671291310081&omit_script=true": Get https://api.twitter.com/1/statuses/oembed.json?id=1085870671291310081&omit_script=true: dial tcp [2400:cb00:2048:1::6814:224e]:443: connect: connection refused
Total in 30017 ms
Error: Error building site: "/mnt/d/Code/hugo-theme-verse/exampleSite/content/posts/rich-content.md:1:1": timed out initializing value. This is most likely a circular loop in a shortcode

Using proxies (with proxychains4) doesn't help on my computer. Hence, this file content/post/rich-content.md is temporarily removed from exampleSite, waiting for future resolvement.

@Creedowl
Copy link
Collaborator

Creedowl commented Feb 1, 2020

proxychains4 works well on my computer, please check your network

@queensferryme
Copy link
Owner Author

Related issues: gohugoio/hugo#5659, gohugoio/hugo#6954, gohugoio/hugo#7228

@queensferryme
Copy link
Owner Author

Related issues: rofl0r/proxychains-ng#199

As mentioned by the author of proxychains-ng:

proxychains hooks to dynamically loaded libc.

  1. go doesn't even use libc, it uses its own syscall wrappers
  2. go doesn't use dynamic linking, it uses static linking

so there's no way we could use this technique with go. the only way to hook into go binaries would be by using ptrace to hook the system calls themselves, which is hairy and platform-dependent - i.e. it means it would be a lot more work to produce and maintain.
so i fear it is out of scope for this utility.

A possible alternative would be using graftcp.

@queensferryme queensferryme added the bug Something isn't working label Feb 25, 2021
@queensferryme
Copy link
Owner Author

Golang does not use libc, so proxychains-ng won't work. Turns out the solution is actually simple: set env vars like HTTP_PROXY and HTTPS_PROXY etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants