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

MustWaitDownload: "invalid memory address or nil pointer dereference" #916

Open
jvegaseg opened this issue Aug 14, 2023 · 3 comments
Open
Labels
question Questions related to rod

Comments

@jvegaseg
Copy link

jvegaseg commented Aug 14, 2023

Rod Version: v0.114.2.

From time to time, I get this error:

error => error value: "invalid memory address or nil pointer dereference"
goroutine 452393 [running]:
runtime/debug.Stack()
/usr/local/go/src/runtime/debug/stack.go:24 +0x67
github.com/go-rod/rod.Try.func1()
/root/go/pkg/mod/github.com/go-rod/rod@v0.114.2/utils.go:213 +0x47
panic({0x299c7a0?, 0x45e1810?})
/usr/local/go/src/runtime/panic.go:920 +0x270
github.com/go-rod/rod.(*Browser).MustWaitDownload.func1()
/root/go/pkg/mod/github.com/go-rod/rod@v0.114.2/must.go:127 +0xb4

The code which generates the error is very simple.

err = rod.Try(func() {
   wait := b.Browser.Timeout(options.Timeout).MustWaitDownload()
   el.MustClick()
   content = wait()
})

Seems something internal to rod.

@jvegaseg jvegaseg added the question Questions related to rod label Aug 14, 2023
@github-actions
Copy link

Please fix the format of your markdown:

30 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 2]
31 MD012/no-multiple-blanks Multiple consecutive blank lines [Expected: 1; Actual: 3]

generated by check-issue

@ysmood
Copy link
Collaborator

ysmood commented Aug 15, 2023

Could you provide more info to help us reproduce it?

@jvegaseg
Copy link
Author

jvegaseg commented Dec 4, 2023

Of course, here you have some logs issued by ROD package and the callstack when panics.
Take in account that it is very random, sometimes it works and sometimes not.

`[2023-12-04 22:30:45.8625] DEBUG  : [3]: [ROD] => [wait]stable<page:F419AE4C>
[2023-12-04 22:30:46.5122] DEBUG  : [3]: [ROD] => [wait]dom-stable<page:F419AE4C>
[2023-12-04 22:30:46.5127] DEBUG  : [3]: [ROD] => [wait]load<page:F419AE4C>
[2023-12-04 22:30:46.5136] DEBUG  : [3]: [ROD] => [wait]request-idle<page:F419AE4C>
[2023-12-04 22:30:46.5546] DEBUG  : [3]: [ROD] => [wait requests idle]map[excludes:[] includes:[]] <page:F419AE4C>
[2023-12-04 22:30:47.5636] DEBUG  : [3]: [ROD] => [wait requests]<page:F419AE4C> map[]
[2023-12-04 22:30:49.7304] DEBUG  : [3]: [ROD] => [query]rod.element(".frame")  <page:F419AE4C>
[2023-12-04 22:30:49.7446] DEBUG  : [3]: [ROD] => [query]rod.element("#cuentaCompleta0")  <page:F419AE4C>
[2023-12-04 22:30:49.7605] DEBUG  : [3]: [ROD] => [query]rod.element("input[name=\"t_divisa\"]")  <page:F419AE4C>
[2023-12-04 22:30:49.7690] DEBUG  : [3]: [ROD] => [query]rod.element("#listIcons > ul > li:nth-child(1) > a")  <page:F419AE4C>
[2023-12-04 22:30:49.7785] DEBUG  : [3]: [ROD] => [wait]interactable<a.ico_excelFile>
[2023-12-04 22:30:49.7869] DEBUG  : [3]: [ROD] => [input]scroll into view<a.ico_excelFile>
[2023-12-04 22:30:49.7886] DEBUG  : [3]: [ROD] => [wait]visible<a.ico_excelFile>
[2023-12-04 22:30:49.7942] DEBUG  : [3]: [ROD] => [wait]stable RAF<a.ico_excelFile>
[2023-12-04 22:30:49.8425] DEBUG  : [3]: [ROD] => [wait]enabled<a.ico_excelFile>
[2023-12-04 22:30:49.8458] DEBUG  : [3]: [ROD] => [input]left click<a.ico_excelFile>
[2023-12-04 22:31:19.7794] DEBUG  : [1]: DownloadOnClick: #listIcons > ul > li:nth-child(1) > a => error value: "invalid memory address or nil pointer dereference"
goroutine 15916 [running]:
runtime/debug.Stack()
        /usr/local/go/src/runtime/debug/stack.go:24 +0x67
github.com/go-rod/rod.Try.func1()
        /root/go/pkg/mod/github.com/go-rod/rod@v0.114.5/utils.go:213 +0x47
panic({0x29fb000?, 0x463ec50?})
        /usr/local/go/src/runtime/panic.go:920 +0x270
github.com/go-rod/rod.(*Browser).MustWaitDownload.func1()
        /root/go/pkg/mod/github.com/go-rod/rod@v0.114.5/must.go:128 +0xb4
vegator/vgtlib/navigator.(*Navigator).DownloadOnClick.func1()
        /opt/vegator/vgtlib/navigator/rod.go:339 +0xaf
github.com/go-rod/rod.Try(0xc000c295a0)
        /root/go/pkg/mod/github.com/go-rod/rod@v0.114.5/utils.go:217 +0x6c
vegator/vgtlib/navigator.(*Navigator).DownloadOnClick(0xc0003fb030, {0x2d718ff, 0x25}, {0xc001039400, 0x38}, {0x0, 0x0, 0x0})
        /opt/vegator/vgtlib/navigator/rod.go:336 +0x24e
`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Questions related to rod
Projects
None yet
Development

No branches or pull requests

2 participants