hugo
hugo copied to clipboard
Hugo cant make resources.GetRemote requests on WSL Version 2
What version of Hugo are you using (hugo version
)?
$ hugo version hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
Does this issue reproduce with the latest release?
Yes
Start building sites … hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio WARN 2022/07/16 00:28:16 error calling resources.GetRemote: Post "": unsupported protocol scheme "" WARN 2022/07/16 00:28:16 error calling resources.GetRemote: Post "": unsupported protocol scheme ""
However, the issue does not occur when executing the same code Hugo.exe file generated for Windows
$hugo.exe version hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended windows/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
WSL Information
PS C:\Users\benz_> wsl --status Default Distribution: Ubuntu Default Version: 2 Windows Subsystem for Linux was last updated on 15-07-2022 The Windows Subsystem for Linux kernel can be manually updated with 'wsl --update', but automatic updates cannot occur due to your system settings. To receive automatic kernel updates, please enable the Windows Update setting: 'Receive updates for other Microsoft products when you update Windows'. For more information please visit https://aka.ms/wsl2kernel. Kernel version: 5.10.16
I am unable to reproduce the problem as described.
WSL status:
PS C:\WINDOWS\system32> wsl --status
Default Distribution: Ubuntu-20.04
Default Version: 2
Windows Subsystem for Linux was last updated on 7/23/2022
WSL automatic updates are on.
Kernel version: 5.10.102.1
Hugo version:
jmooring@PC-JMOORING:/mnt/c/Users/joe/Code/hugo-testing$ hugo version
hugo v0.101.0-466fa43c16709b4483689930a4f9ac8add5c9f66+extended linux/amd64 BuildDate=2022-06-16T07:09:16Z VendorInfo=gohugoio
Template code:
{{ with resources.GetRemote "https://gohugo.io/img/hugo-logo.png" }}
<img src="{{ .RelPermalink }}" width="{{ .Width }}" height="{{ .Height }}" alt="Hugo logo">
{{ end }}
I would tend to close this issue. Connectivity problems in WSL2 are common in all sorts of scenarios because the network setup between the WSL2 VM and the Windows host is convoluted. Wild guess: some firewall rule in the Windows host allows traffic only for one of the two calls.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.