getgauge / taiko

A node.js library for testing modern web applications
https://taiko.dev
MIT License
3.57k stars 453 forks source link

invalid memory address or nil pointer dereference in azure devops pipeline #2594

Closed fundabdeniz closed 2 years ago

fundabdeniz commented 2 years ago

Describe the bug

Specs are not working on Azure pipeline.

To Reproduce

1.On an Windows Server 2012 R2 Azure agent machine; When I try to run the following command on the cli inside the machine, it works successfully. gauge run specs

2.But when I try to run it through Azure pipeline on powershell or cmd tasks it gives the following error.

gauge run specs

Logs

internal/modules/cjs/loader.js:905
throw err;
^
Error: Cannot find module 'C:\Users\engineering\AppData\Roaming\gauge\plugins\js\2.4.0\src\gauge.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Error ----------------------------------

[Gauge]
Error: runtime error: invalid memory address or nil pointer dereference
goroutine 1 [running]:
runtime/debug.Stack(0xc00000f240, 0x13e1480, 0x19a2a30)
    C:/hostedtoolcache/windows/go/1.16.13/x64/src/runtime/debug/stack.go:24 +0xa5
main.recoverPanic()
    D:/a/gauge/gauge/gauge.go:27 +0x65
panic(0x13e1480, 0x19a2a30)
    C:/hostedtoolcache/windows/go/1.16.13/x64/src/runtime/panic.go:965 +0x1c7
github.com/getgauge/gauge/runner.(*GrpcRunner).ExecuteMessageWithTimeout(0x0, 0xc0000aa580, 0x0, 0xc0006a8140, 0x0)
    D:/a/gauge/gauge/runner/grpcRunner.go:195 +0x29
github.com/getgauge/gauge/validation.(*SpecValidator).validateStep(0xc0006a8000, 0xc0003fe000, 0xc00040d830, 0x22)
    D:/a/gauge/gauge/validation/validate.go:345 +0x1ba
github.com/getgauge/gauge/validation.(*SpecValidator).Step(0xc0006a8000, 0xc0003fe000)
    D:/a/gauge/gauge/validation/validate.go:313 +0x5c5
github.com/getgauge/gauge/validation.(*SpecValidator).Step(0xc0006a8000, 0xc0000db800)
    D:/a/gauge/gauge/validation/validate.go:307 +0x87
github.com/getgauge/gauge/gauge.(*Specification).Traverse(0xc000170480, 0x15bb7f8, 0xc0006a8000, 0xc00000f988)
    D:/a/gauge/gauge/gauge/specification.go:261 +0x26a
github.com/getgauge/gauge/validation.(*SpecValidator).validate(0xc0006a8000, 0xc0006a8000, 0x13, 0x100000001)
    D:/a/gauge/gauge/validation/validate.go:298 +0x94
github.com/getgauge/gauge/validation.(*validator).Validate(0xc00000fb38, 0x15bad00)
    D:/a/gauge/gauge/validation/validate.go:284 +0x11c
github.com/getgauge/gauge/validation.ValidateSpecs(0xc0000940c0, 0x1, 0x1, 0x0, 0x0)
    D:/a/gauge/gauge/validation/validate.go:174 +0x245
github.com/getgauge/gauge/execution.glob..func1(0xc0000940c0, 0x1, 0x1, 0x0)
    D:/a/gauge/gauge/execution/execute.go:107 +0x119
github.com/getgauge/gauge/cmd.execute(0x19b0760, 0xc0000940c0, 0x1, 0x1)
    D:/a/gauge/gauge/cmd/run.go:241 +0x22e
github.com/getgauge/gauge/cmd.glob..func12(0x19b0760, 0xc0000940c0, 0x1, 0x1)
    D:/a/gauge/gauge/cmd/run.go:90 +0x26e
github.com/spf13/cobra.(*Command).execute(0x19b0760, 0xc000094090, 0x1, 0x1, 0x19b0760, 0xc000094090)
    C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:856 +0x2c2
github.com/spf13/cobra.(*Command).ExecuteC(0x19ae6e0, 0x0, 0xc00005ff78, 0xc000121f78)
    C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:960 +0x375
github.com/spf13/cobra.(*Command).Execute(...)
    C:/Users/runneradmin/go/pkg/mod/github.com/spf13/cobra@v1.1.3/command.go:897
github.com/getgauge/gauge/cmd.Parse(0xccb901, 0x0)
    D:/a/gauge/gauge/cmd/cmd.go:112 +0x45
main.main()
    D:/a/gauge/gauge/gauge.go:19 +0x4f

Versions:

Gauge version: 1.1.
Commit Hash: 6e0d83

Plugins
-------
html-report (4.0.12
js (2.3.12)
screenshot (0.0.1)
zabil commented 2 years ago

Closing as duplicate of https://github.com/getgauge/gauge/issues/2246