gauge-vscode icon indicating copy to clipboard operation
gauge-vscode copied to clipboard

The Gauge server crashed 5 times in the last 3 minutes. The server will not be restarted. Getting this as soon as I open VS Code

Open ayankumaar opened this issue 3 years ago • 15 comments

I am seeing following error "The Gauge server crashed 5 times in the last 3 minutes. The server will not be restarted" as soon as I launch VS Code.

I am unable to run my scripts. When I did "gauge run specs" I got the following error

Error ----------------------------------

[Gauge] Error: runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: runtime/debug.Stack(0xc0000a5400, 0xb4e960, 0x123f760) XX:/hostedtoolcache/windows/go/1.13.15/x64/src/runtime/debug/stack.go:24 +0xa4 main.recoverPanic() XX:/a/gauge/gauge/gauge.go:27 +0x5e panic(0xb4e960, 0x123f760) XX:/hostedtoolcache/windows/go/1.13.15/x64/src/runtime/panic.go:679 +0x1c0 github.com/getgauge/gauge/runner.(*GrpcRunner).ExecuteMessageWithTimeout(0x0, 0xc0003d2000, 0x41fdb00, 0xc0003b2080, 0x0)
XX:/a/gauge/gauge/runner/grpcRunner.go:195 +0x29 github.com/getgauge/gauge/validation.(*SpecValidator).validateStep(0xc0003b2000, 0xc000314000, 0xc0001b3b80, 0x12) XX:/a/gauge/gauge/validation/validate.go:345 +0x1ab github.com/getgauge/gauge/validation.(*SpecValidator).Step(0xc0003b2000, 0xc000314000) XX:/a/gauge/gauge/validation/validate.go:313 +0x5f8 github.com/getgauge/gauge/gauge.(*Specification).Traverse(0xc000308000, 0xd60b60, 0xc0003b2000, 0xc0000a58d8) XX:/a/gauge/gauge/gauge/specification.go:261 +0x25d github.com/getgauge/gauge/validation.(*SpecValidator).validate(0xc0003b2000, 0xc0003b2000, 0x13, 0x0) XXXX:/a/gauge/gauge/validation/validate.go:298 +0x94 github.com/getgauge/gauge/validation.(*validator).Validate(0xc0000a5a80, 0xd5ffc0) XXXX:/a/gauge/gauge/validation/validate.go:284 +0x11c github.com/getgauge/gauge/validation.ValidateSpecs(0xc000102cf0, 0x1, 0x1, 0x0, 0x0) X:/a/gauge/gauge/validation/validate.go:174 +0x22e github.com/getgauge/gauge/execution.glob..func1(0xc000102cf0, 0x1, 0x1, 0x0) XX:/a/gauge/gauge/execution/execute.go:107 +0xf6 github.com/getgauge/gauge/cmd.execute(0x124bcc0, 0xc000102cf0, 0x1, 0x1) XX:/a/gauge/gauge/cmd/run.go:244 +0x248 github.com/getgauge/gauge/cmd.glob..func12(0x124bcc0, 0xc000102cf0, 0x1, 0x1) XXXX:/a/gauge/gauge/cmd/run.go:93 +0x27a github.com/spf13/cobra.(*Command).execute(0x124bcc0, 0xc000102cc0, 0x1, 0x1, 0x124bcc0, 0xc000102cc0) XX:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:854 +0x2b1 github.com/spf13/cobra.(*Command).ExecuteC(0x124cc80, 0x42fd31, 0x1, 0x124c9e0) XXXX:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x350 github.com/spf13/cobra.(*Command).Execute(...) X:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 github.com/getgauge/gauge/cmd.Parse(0xc0000a5f18, 0xc000065f50) XXXX:/a/gauge/gauge/cmd/cmd.go:112 +0x44 main.main() XX:/a/gauge/gauge/gauge.go:19 +0x53

Get Support ---------------------------- Docs: https://docs.gauge.org Bugs: https://github.com/getgauge/gauge/issues Chat: https://github.com/getgauge/gauge/discussions

Your Environment Information ----------- windows, 1.1.7, 5d86b72 dotnet (0.3.1), html-report (4.0.12), screenshot (0.0.1)

I have the following gauge version in my system:

Gauge version: 1.1.7 Commit Hash: 5d86b72

Plugins

dotnet (0.3.1) html-report (4.0.12) screenshot (0.0.1)

I am using gauge extension version 0.0.19 in VS Code.

Please tell me how to resolve this issue.

ayankumaar avatar Apr 20 '21 07:04 ayankumaar

Can you try upgrading to 1.1.8. Gauge also logs more info in it's log folders. Please share anything that might help.

Or if there's a project/steps that you can share which can replicate the issue that'd be great.

For example

gauge init dotnet
code .
gauge run specs

zabil avatar Apr 20 '21 09:04 zabil

@zabil even after upgrading to 1.1.8. The issue remains. The source of the exception is coming as Gauge Extension. I am using version 0.0.19.

This is what the lsp.log file is giving

Error ----------------------------------

[Gauge] Error: runtime error: invalid memory address or nil pointer dereference goroutine 1 [running]: runtime/debug.Stack(0xc0000a5400, 0xb4e960, 0x123f760) XX:/hostedtoolcache/windows/go/1.13.15/x64/src/runtime/debug/stack.go:24 +0xa4 main.recoverPanic() XX:/a/gauge/gauge/gauge.go:27 +0x5e panic(0xb4e960, 0x123f760) XX:/hostedtoolcache/windows/go/1.13.15/x64/src/runtime/panic.go:679 +0x1c0 github.com/getgauge/gauge/runner.(*GrpcRunner).ExecuteMessageWithTimeout(0x0, 0xc0003d2000, 0x41fdb00, 0xc0003b2080, 0x0) XX:/a/gauge/gauge/runner/grpcRunner.go:195 +0x29 github.com/getgauge/gauge/validation.(*SpecValidator).validateStep(0xc0003b2000, 0xc000314000, 0xc0001b3b80, 0x12) XX:/a/gauge/gauge/validation/validate.go:345 +0x1ab github.com/getgauge/gauge/validation.(*SpecValidator).Step(0xc0003b2000, 0xc000314000) XX:/a/gauge/gauge/validation/validate.go:313 +0x5f8 github.com/getgauge/gauge/gauge.(*Specification).Traverse(0xc000308000, 0xd60b60, 0xc0003b2000, 0xc0000a58d8) XX:/a/gauge/gauge/gauge/specification.go:261 +0x25d github.com/getgauge/gauge/validation.(*SpecValidator).validate(0xc0003b2000, 0xc0003b2000, 0x13, 0x0) XXXX:/a/gauge/gauge/validation/validate.go:298 +0x94 github.com/getgauge/gauge/validation.(*validator).Validate(0xc0000a5a80, 0xd5ffc0) XXXX:/a/gauge/gauge/validation/validate.go:284 +0x11c github.com/getgauge/gauge/validation.ValidateSpecs(0xc000102cf0, 0x1, 0x1, 0x0, 0x0) X:/a/gauge/gauge/validation/validate.go:174 +0x22e github.com/getgauge/gauge/execution.glob..func1(0xc000102cf0, 0x1, 0x1, 0x0) XX:/a/gauge/gauge/execution/execute.go:107 +0xf6 github.com/getgauge/gauge/cmd.execute(0x124bcc0, 0xc000102cf0, 0x1, 0x1) XX:/a/gauge/gauge/cmd/run.go:244 +0x248 github.com/getgauge/gauge/cmd.glob..func12(0x124bcc0, 0xc000102cf0, 0x1, 0x1) XXXX:/a/gauge/gauge/cmd/run.go:93 +0x27a github.com/spf13/cobra.(*Command).execute(0x124bcc0, 0xc000102cc0, 0x1, 0x1, 0x124bcc0, 0xc000102cc0) XX:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:854 +0x2b1 github.com/spf13/cobra.(*Command).ExecuteC(0x124cc80, 0x42fd31, 0x1, 0x124c9e0) XXXX:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:958 +0x350 github.com/spf13/cobra.(*Command).Execute(...) X:/Users/runneradmin/go/pkg/mod/github.com/spf13/[email protected]/command.go:895 github.com/getgauge/gauge/cmd.Parse(0xc0000a5f18, 0xc000065f50) XXXX:/a/gauge/gauge/cmd/cmd.go:112 +0x44 main.main() XX:/a/gauge/gauge/gauge.go:19 +0x53

ayankumaar avatar Apr 20 '21 11:04 ayankumaar

Does this happen on a fresh project on your machine i.e opening gauge init dotnet?

zabil avatar Apr 20 '21 12:04 zabil

@zabil yes it happens after creating a new project as well. When I check lsp.log I see the same error which I just pinged. Also, when I run gauge run specs. I am seeing the same error.

ayankumaar avatar Apr 20 '21 12:04 ayankumaar

@zabil is there any update on the issue ?

ayankumaar avatar Apr 22 '21 11:04 ayankumaar

No updates yet.

Unfortunately don't have access to a windows machine. Plus I don't see enough info like which version of dotnet etc, to debug on another machine.

zabil avatar Apr 22 '21 12:04 zabil

@zabil These are the versions which I have already mentioned:

Gauge version: 1.1.7 Commit Hash: 5d86b72

Plugins dotnet (0.3.1) html-report (4.0.12) screenshot (0.0.1)

I am using gauge extension version 0.0.19 in VS Code.

Please tell me how to resolve this issue.

ayankumaar avatar Apr 22 '21 13:04 ayankumaar

I meant.

Dotnet framework version Windows version

zabil avatar Apr 22 '21 13:04 zabil

Also, as a workaround you could try downgrading to a version that was working for you earlier until this issue can be looked at.

zabil avatar Apr 22 '21 13:04 zabil

@zabil .NET Framework version is .NET Core 3.1.407 and Operating system is windows 10. Let me know if you need any other information.

ayankumaar avatar Apr 22 '21 14:04 ayankumaar

The stacktrace makes me guess that gauge could not bring up the dotnet runner correctly. Do you see any other information in gauge.log file?

sriv avatar Apr 23 '21 02:04 sriv

Hey guys, @sriv @zabil Im having this issue in my new typeScript project with gauge. Somehow in windows machines works perfectly and in mac machines is failing.

These are my versions: Gauge version: 1.4.3 Plugins

html-report (4.1.0) java (0.7.9) json-report (0.3.6) reportportal (1.12.0) screenshot (0.1.0) spectacle (0.1.4) ts (0.1.0) xml-report (0.2.3)

Im attaching as well gauge logs:

15-05-2022 23:17:21.161 [Gauge] [INFO] Initializing concepts cache with 0 concepts 15-05-2022 23:17:21.162 [Gauge] [INFO] Initializing specs cache with 3 specs 15-05-2022 23:17:21.162 [Gauge] [DEBUG] Adding specs from /Users/jonathangiber/IdeaProjects/automation-tests-iso/specs/doc_isolation/di_download.spec 15-05-2022 23:17:21.162 [Gauge] [DEBUG] Adding specs from /Users/jonathangiber/IdeaProjects/automation-tests-iso/specs/doc_isolation/di_password.spec 15-05-2022 23:17:21.162 [Gauge] [DEBUG] Adding specs from /Users/jonathangiber/IdeaProjects/automation-tests-iso/specs/doc_isolation/di_viewer.spec 15-05-2022 23:17:21.162 [Gauge] [INFO] Initializing steps cache with 3 steps 15-05-2022 23:17:21.163 [Gauge] [INFO] Starting language runner 15-05-2022 23:17:21.163 [Gauge] [DEBUG] Watching directory: /Users/jonathangiber/IdeaProjects/automation-tests-iso/specs 15-05-2022 23:17:21.163 [Gauge] [DEBUG] Found 1 files 15-05-2022 23:17:21.163 [Gauge] [DEBUG] Watching directory: /Users/jonathangiber/IdeaProjects/automation-tests-iso/specs/doc_isolation 15-05-2022 23:17:21.163 [Gauge] [DEBUG] Found 3 files 15-05-2022 23:17:23.504 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 53483 15-05-2022 23:17:23.507 [Gauge] [DEBUG] Successfully made the connection with runner with port: 53483 15-05-2022 23:17:23.507 [Gauge] [INFO] LangServer: reading on stdin, writing on stdout 15-05-2022 23:17:23.507 [Gauge] [DEBUG] jsonrpc2: --> request #0: initialize: {"processId":35667,"clientInfo":{"name":"Visual Studio Code","version":"1.65.2"},"locale":"en-us","rootPath":"/Users/jonathangiber/IdeaProjects/automation-tests-iso","rootUri":"file:///Users/jonathangiber/IdeaProjects/automation-tests-iso","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional","normalizesLineEndings":true,"changeAnnotationSupport":{"groupsOnLabel":true}},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"tagSupport":{"valueSet":[1]}},"codeLens":{"refreshSupport":true},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true,"semanticTokens":{"refreshSupport":true},"fileOperations":{"dynamicRegistration":true,"didCreate":true,"didRename":true,"didDelete":true,"willCreate":true,"willRename":true,"willDelete":true}},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]},"codeDescriptionSupport":true,"dataSupport":true},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]},"insertReplaceSupport":true,"resolveSupport":{"properties":["documentation","detail","additionalTextEdits"]},"insertTextModeSupport":{"valueSet":[1,2]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true},"activeParameterSupport":true},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true,"tagSupport":{"valueSet":[1]},"labelSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"disabledSupport":true,"dataSupport":true,"resolveSupport":{"properties":["edit"]},"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}},"honorsChangeAnnotations":false},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true,"prepareSupportDefaultBehavior":1,"honorsChangeAnnotations":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["namespace","type","class","enum","interface","struct","typeParameter","parameter","variable","property","enumMember","event","function","method","macro","keyword","modifier","comment","string","number","regexp","operator"],"tokenModifiers":["declaration","definition","readonly","static","deprecated","abstract","async","modification","documentation","defaultLibrary"],"formats":["relative"],"requests":{"range":true,"full":{"delta":true}},"multilineTokenSupport":false,"overlappingTokenSupport":false},"linkedEditingRange":{"dynamicRegistration":true}},"window":{"showMessage":{"messageActionItem":{"additionalPropertiesSupport":true}},"showDocument":{"support":true},"workDoneProgress":true},"general":{"regularExpressions":{"engine":"ECMAScript","version":"ES2020"},"markdown":{"parser":"marked","version":"1.1.0"}},"saveFiles":true},"trace":"off","workspaceFolders":[{"uri":"file:///Users/jonathangiber/IdeaProjects/automation-tests-iso","name":"automation-tests-iso"}]} 15-05-2022 23:17:23.507 [Gauge] [DEBUG] jsonrpc2: protocol error: read /dev/stdin: resource temporarily unavailable 15-05-2022 23:17:23.508 [Gauge] [DEBUG] jsonrpc2 handler: sending response 0: jsonrpc2: connection is closed 15-05-2022 23:17:23.715 [Gauge] [DEBUG] Runner with PID:35820 has exited 15-05-2022 23:17:23.715 [Gauge] [INFO] Connection closed 15-05-2022 23:17:23.715 [Gauge] [ERROR] Unable to log error 'Connection closed' to LSP: jsonrpc2: connection is closed

Any other information I may provide please let me know

Screen Shot 2022-05-15 at 23 22 19

jonathangiber avatar May 15 '22 20:05 jonathangiber

Never mind, this one solved it for me -> https://github.com/getgauge/gauge-vscode/issues/735#issuecomment-957850915

jonathangiber avatar May 15 '22 20:05 jonathangiber

The issue is still there for a long time now and for me there's only one workaround that was mentioned above by @jonathangiber: https://github.com/getgauge/gauge-vscode/issues/735#issuecomment-957850915

bormando avatar Jun 02 '22 09:06 bormando

@BugDiver may have more hints if this is a typescript project.

sriv avatar Jun 02 '22 10:06 sriv

Is there a proper fix for this issue yet? Is there anything we can do to help get this issue fixed? @zabil @sriv @BugDiver

I commented my findings on a similar issue here a few weeks ago but there hasn't been any response so far.

This extension is essentially useless for TS projects at the moment and this problem is hampering the adoption of Gauge. Please (let us help) fix it!

bvobart avatar Apr 20 '23 15:04 bvobart

weird - I had this working no issues on my machine. I have come back to it, and the only difference being that I have installed (via npm) axios dependency. Now, I'm getting this error. Is this project dead?

AndyBrownlie avatar Oct 24 '23 11:10 AndyBrownlie

Is this project dead?

@AndyBrownlie info project status is available here https://github.com/getgauge/gauge#important-note

zabil avatar Oct 24 '23 13:10 zabil

thanks for the info Zabil 👍

AndyBrownlie avatar Oct 24 '23 14:10 AndyBrownlie

weird - I had this working no issues on my machine. I have come back to it, and the only difference being that I have installed (via npm) axios dependency. Now, I'm getting this error. Is this project dead?

@AndyBrownlie Did you also update ts-node by any chance? This related issue notes that the version of ts-node used by your project causes this error. I verified in my own project that downgrading ts-node to version 8.7.0 fixes the issue for me.

bvobart avatar Oct 24 '23 14:10 bvobart

Funnily enough bvobart, I was getting ts-node errors on build when I returned to the project (don't recall having them before I left it!) so I cleared my node_modules folder and did a full npm install again. My version of ts-node was 10.9.1 so I reverted back to 8.7.0 and tried again. This has eradicated the crashing 5 times error, but now I've got the problem where gauge doesn't recognise the step files (Step Implementation not found) despite following what worked for me before.

I'm beginning to wonder if it would be better to build my gauge step implementations using java as these all seem to be typescript incompatibilities..

AndyBrownlie avatar Oct 25 '23 08:10 AndyBrownlie

@AndyBrownlie Glad to hear that fixed the crashing 5 times error!

... now I've got the problem where gauge doesn't recognise the step files (Step Implementation not found) despite following what worked for me before.

iirc Gauge in a TS project requires that the step implementation files be saved in the steps folder by default and each of those files must have a default export of a class that contains methods with the @Step annotation.

If that does not solve your problem, it might be worth creating a new issue with a MWE of the problem you're having.

P.S. your link seems to be missing its target URL.

I'm beginning to wonder if it would be better to build my gauge step implementations using java as these all seem to be typescript incompatibilities..

I don't have any experience with the Java implementation, but my educated guess is that the Java implementation is indeed more mature than the TS one. However, you should use what language makes sense for your context. If all your (company's) projects are in TS and there are no or few employees that understand Java, then it probably does not make sense for your context to use Java. On the other hand, if you already have a significant Java codebase and have no problems maintaining that, then using the Java implementation might actually make a lot more sense.

bvobart avatar Oct 25 '23 14:10 bvobart

thanks again for the reply @bvobart

P.S. your link seems to be missing its target URL.

Thanks - fixed it.

iirc Gauge in a TS project requires that the step implementation files be saved in the steps folder by default and each of those files must have a default export of a class that contains methods with the @Step annotation.

Yeah, I have moved mine but I added a /env/default/ts.properties file with the following entry STEP_IMPL_DIR = ./tests/specs/_steps and all my step files have a default class export with @Step annotations. I've had it working, it just seems to be that since I revisited it, and perhaps had to update some npm packages, its stopped working.

However, you should use what language makes sense for your context.

I appreciate the advice - we are lucky we have full stack engineers with typescript & java so I'm very tempted. I love Gauge so it might be worth making the jump before we do much more. Thanks again.

AndyBrownlie avatar Oct 25 '23 18:10 AndyBrownlie

thanks again for the reply @bvobart

You're welcome!

Yeah, I have moved mine but I added a /env/default/ts.properties file with the following entry STEP_IMPL_DIR = ./tests/specs/_steps and all my step files have a default class export with @step annotations. I've had it working, it just seems to be that since I revisited it, and perhaps had to update some npm packages, its stopped working.

Hmmmm that sounds like it should be legit. That's strange then. I'm not sure I can help you any further, but maybe you could try moving your step files into the default steps directory, removing that property entry and seeing if that fixes the problem? If so, then it's an issue with how Gauge-TS picks up that specific property.

I appreciate the advice - we are lucky we have full stack engineers with typescript & java so I'm very tempted. I love Gauge so it might be worth making the jump before we do much more. Thanks again.

Ahh great, that's fortunate! Switching to the Java implementation may definitely make sense for you then, especially when the TS implementation keeps throwing bugs at you.

bvobart avatar Oct 26 '23 14:10 bvobart

FYI someone's fixing this issue Refer https://github.com/getgauge/gauge/issues/2419

zabil avatar Oct 26 '23 15:10 zabil

Hopefully fixed by https://github.com/getgauge/gauge/pull/2422 in Gauge 1.5.6 - we can re-open if it turns out not to be the case.

chadlwilson avatar Oct 27 '23 01:10 chadlwilson