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

Index out of range #33

Open
MaximLeyenson opened this issue Jan 4, 2025 · 1 comment
Open

Index out of range #33

MaximLeyenson opened this issue Jan 4, 2025 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@MaximLeyenson
Copy link

Index out of range

Running for the first time this year. Getting

$harsh ask
panic: runtime error: index out of range [1] with length 1

goroutine 1 [running]:
main.loadHabitsConfig({0xc0000c4520?, 0x1?})
	/home/runner/work/harsh/harsh/harsh.go:639 +0x59a
main.newHarsh()
	/home/runner/work/harsh/harsh/harsh.go:257 +0x31
main.main.func1(0xc0000a6700)
	/home/runner/work/harsh/harsh/harsh.go:87 +0x18
github.com/urfave/cli/v2.(*Command).Run(0xc000142000, 0xc0000a6700, {0xc000095040, 0x1, 0x1})
	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:276 +0x7e2
github.com/urfave/cli/v2.(*Command).Run(0xc0001426e0, 0xc0000a6540, {0xc0000aa000, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/command.go:269 +0xa65
github.com/urfave/cli/v2.(*App).RunContext(0xc000136200, {0x634398, 0x7a9940}, {0xc0000aa000, 0x2, 0x2})
	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:333 +0x5a5
github.com/urfave/cli/v2.(*App).Run(...)
	/home/runner/go/pkg/mod/github.com/urfave/cli/[email protected]/app.go:307
main.main()
	/home/runner/work/harsh/harsh/harsh.go:249 +0x592

Fresh reinstall did not help (using curl).

Environment (please complete the following information):

  • Linux Mint 22 Wilma

  • OS version: Linux 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

  • Harsh version : 0.10.6

Thank you in advance!

@MaximLeyenson MaximLeyenson added the bug Something isn't working label Jan 4, 2025
@wakatara
Copy link
Owner

wakatara commented Jan 5, 2025

@MaximLeyenson

Happy New Year! and thanks for using (or trying) harsh!

Generally, we see these sort of out of range errors when there is a difference in the way the habit is written vs the way the entry in the log is written.

My guess would be that you either edited you habit file slightly (or accidentally?) or manually altered the log file via the text editor in some way. (another thing to check for since this even caught me once, is if you have an invisible entity in the log file at the end of the line, like a pasted hard return character from vim or similar.)

lemme know if that sorts you out - I am going to wade in and try and find a better way to raise this error with a meaningful message or not this week I think since it's happened more than once and the message is confusing (as you've seen).

@wakatara wakatara self-assigned this Jan 5, 2025
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