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

Panic when importing a jekyll site #9817

Closed
Pondidum opened this issue Apr 24, 2022 · 6 comments · Fixed by #9912
Closed

Panic when importing a jekyll site #9817

Pondidum opened this issue Apr 24, 2022 · 6 comments · Fixed by #9912

Comments

@Pondidum
Copy link

What version of Hugo are you using (hugo version)?

$ hugo version
hugo v0.97.3-078053a43d746a26aa3d48cf1ec7122ae78a9bb4 linux/amd64 BuildDate=2022-04-18T17:22:19Z VendorInfo=gohugoio

Does this issue reproduce with the latest release?

Yes


Trying to import my current blog from jekyll to hugo is causing a panic, and regardless of what pathing I try (absolute, relative, etc), it always occurs.

hugo import jekyll ../projects/pondidum.github.io/ ./blog
panic: workingDir is too short

goroutine 1 [running]:
github.com/gohugoio/hugo/hugofs.newFs({0x2554120, 0x35b5940}, {0x2554120?, 0x35b5940}, {0x25547c0, 0xc000964c00})
	/root/project/hugo/hugofs/fs.go:101 +0x4ee
github.com/gohugoio/hugo/hugofs.NewDefault(...)
	/root/project/hugo/hugofs/fs.go:68
github.com/gohugoio/hugo/deps.New({{0x2555a98, 0xc00052c750}, 0x0, 0xc000964c00, {0x0, 0x0}, {0x25547c0, 0xc000964b00}, {0xc00020b000, 0x21, ...}, ...})
	/root/project/hugo/deps/deps.go:226 +0xf8
github.com/gohugoio/hugo/hugolib.configLoader.applyDeps({{0x0, 0x0}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	/root/project/hugo/hugolib/hugo_sites.go:517 +0x31e
github.com/gohugoio/hugo/hugolib.newHugoSites({{0x2555a98, 0xc00052c750}, 0x0, 0x0, {0x0, 0x0}, {0x25547c0, 0xc000964b00}, {0x0, 0x0, ...}, ...}, ...)
	/root/project/hugo/hugolib/hugo_sites.go:404 +0x766
github.com/gohugoio/hugo/hugolib.NewHugoSites({{0x2555a98, 0xc00052c750}, 0x0, 0x0, {0x0, 0x0}, {0x25547c0, 0xc000964b00}, {0x0, 0x0, ...}, ...})
	/root/project/hugo/hugolib/hugo_sites.go:553 +0x11d
github.com/gohugoio/hugo/hugolib.NewSiteForCfg(...)
	/root/project/hugo/hugolib/site.go:643
github.com/gohugoio/hugo/hugolib.newSiteForLang(0xc000964b00, {0x0, 0x0, 0x0})
	/root/project/hugo/hugolib/site.go:636 +0x138
github.com/gohugoio/hugo/hugolib.NewSiteDefaultLang({0x0, 0x0, 0x0})
	/root/project/hugo/hugolib/site.go:608 +0x154
github.com/gohugoio/hugo/commands.(*importCmd).createSiteFromJekyll(0xc000042f30?, {0xc000042f00, 0x2a}, {0xc000042f30, 0x21}, 0xb?, 0x0)
	/root/project/hugo/commands/import_jekyll.go:204 +0x67
github.com/gohugoio/hugo/commands.(*importCmd).importFromJekyll(0x8d58c0?, 0xc0008ffd00?, {0xc000555320, 0x0?, 0x0?})
	/root/project/hugo/commands/import_jekyll.go:108 +0x214
github.com/spf13/cobra.(*Command).execute(0xc000435b80, {0xc0005552c0, 0x2, 0x2})
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:856 +0x67c
github.com/spf13/cobra.(*Command).ExecuteC(0xc000957680)
	/go/pkg/mod/github.com/spf13/cobra@v1.4.0/command.go:974 +0x3b4
github.com/gohugoio/hugo/commands.Execute({0xc00003a0b0, 0x4, 0x4})
	/root/project/hugo/commands/hugo.go:93 +0xb4
main.main()
	/root/project/hugo/main.go:23 +0x57
@Pondidum
Copy link
Author

Pondidum commented Apr 24, 2022

Just checked and the latest version of hugo I could find in a container worked (0.95)

@jmooring
Copy link
Member

jmooring commented Apr 24, 2022

Confirmed. Problem was introduced in v0.97.0. Git bisect says d070bdf is the first bad commit.

To reproduce:

git clone https://gitlab.com/pages/jekyll
hugo import jekyll jekyll/ hugo/

@sanojsubran
Copy link

I also observed the same issue with jekyll import in Windows.

In fs.go, in the function func newFs(source, destination afero.Fs, cfg config.Provider) *Fs, there is a sanity check failing since the workingDir var is not getting initialized properly. From the new code flow, I am not sure whether the sanity check for workingDir is required or not.

@bep bep added this to the v0.99.0 milestone Apr 28, 2022
@DeepakVadgama
Copy link

DeepakVadgama commented May 5, 2022

Happening on MacOS as well

hugo version hugo v0.98.0+extended darwin/arm64 BuildDate=unknown

hugo import jekyll --log  ~/Projects/jekyll ~/Projects/blog
panic: workingDir is too short

goroutine 1 [running]:
github.com/gohugoio/hugo/hugofs.newFs({0x1049c48d8, 0x105a7a480}, {0x1049c48d8?, 0x105a7a480}, {0x1049c4f78, 0x14000670f00})
	github.com/gohugoio/hugo/hugofs/fs.go:101 +0x488
github.com/gohugoio/hugo/hugofs.NewDefault(...)
	github.com/gohugoio/hugo/hugofs/fs.go:68
github.com/gohugoio/hugo/deps.New({{0x1049c5bf8, 0x14000548540}, 0x0, 0x14000670f00, {0x0, 0x0}, {0x1049c4f78, 0x14000670e00}, {0x1400057c000, 0x21, ...}, ...})
	github.com/gohugoio/hugo/deps/deps.go:226 +0xd4
github.com/gohugoio/hugo/hugolib.configLoader.applyDeps({{0x0, 0x0}, {{0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, {0x0, 0x0}, ...}}, ...)
	github.com/gohugoio/hugo/hugolib/hugo_sites.go:517 +0x224
github.com/gohugoio/hugo/hugolib.newHugoSites({{0x1049c5bf8, 0x14000548540}, 0x0, 0x0, {0x0, 0x0}, {0x1049c4f78, 0x14000670e00}, {0x0, 0x0, ...}, ...}, ...)
	github.com/gohugoio/hugo/hugolib/hugo_sites.go:404 +0x680
github.com/gohugoio/hugo/hugolib.NewHugoSites({{0x1049c5bf8, 0x14000548540}, 0x0, 0x0, {0x0, 0x0}, {0x1049c4f78, 0x14000670e00}, {0x0, 0x0, ...}, ...})
	github.com/gohugoio/hugo/hugolib/hugo_sites.go:553 +0xe0
github.com/gohugoio/hugo/hugolib.NewSiteForCfg(...)
	github.com/gohugoio/hugo/hugolib/site.go:643
github.com/gohugoio/hugo/hugolib.newSiteForLang(0x14000670e00, {0x0, 0x0, 0x0})
	github.com/gohugoio/hugo/hugolib/site.go:636 +0xd4
github.com/gohugoio/hugo/hugolib.NewSiteDefaultLang({0x0, 0x0, 0x0})
	github.com/gohugoio/hugo/hugolib/site.go:608 +0xf4
github.com/gohugoio/hugo/commands.(*importCmd).createSiteFromJekyll(0x16d71b867?, {0x16d71b831, 0x35}, {0x16d71b867, 0x22}, 0x5?, 0x0)
	github.com/gohugoio/hugo/commands/import_jekyll.go:204 +0x48
github.com/gohugoio/hugo/commands.(*importCmd).importFromJekyll(0x14000223200?, 0x102b51870?, {0x1400052bce0, 0x14000955cb8?, 0x0?})
	github.com/gohugoio/hugo/commands/import_jekyll.go:108 +0x19c
github.com/spf13/cobra.(*Command).execute(0x1400065aa00, {0x1400052bcb0, 0x3, 0x3})
	github.com/spf13/cobra@v1.4.0/command.go:856 +0x4c4
github.com/spf13/cobra.(*Command).ExecuteC(0x1400065d400)
	github.com/spf13/cobra@v1.4.0/command.go:974 +0x354
github.com/gohugoio/hugo/commands.Execute({0x1400003c1f0, 0x5, 0x5})
	github.com/gohugoio/hugo/commands/hugo.go:93 +0x98
main.main()
	github.com/gohugoio/hugo/main.go:23 +0x54

satotake added a commit to satotake/hugo that referenced this issue May 21, 2022
Just use `afero.OsFs` without building site.
Close gohugoio#9817
@bep bep closed this as completed in #9912 May 21, 2022
bep pushed a commit that referenced this issue May 21, 2022
Just use `afero.OsFs` without building site.
Close #9817
@c-alpha
Copy link

c-alpha commented May 23, 2022

0.99.2 any soon? Just saying... and because it bites me...

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants