gauge icon indicating copy to clipboard operation
gauge copied to clipboard

transport is closing and runner is not alive

Open yinzhenzhixin opened this issue 4 years ago • 11 comments

Describe the bug I came across the issue after I install gauge-python and run gauge with python projects

To Reproduce Steps (or project) to reproduce the behavior:

  1. Initialise a gauge project
  2. Run the gauge command
  3. See error
$ gauge init python
$ gauge run specs

Logs gauge run .\specs
log-level : [debug] 'gauge_environment' set to 'default' Created gauge_screenshots_dir at Plugin python is already installed. Plugin html-report is already installed. Plugin xml-report is already installed. Plugin screenshot is already installed. Parsing started. Started concepts parsing. 3 concepts parsing completed. Started specifications parsing. 3 specifications parsing completed. Parsing completed. Python: 3.9.1 Loading step implementations from C:\step_impl dirs. Starting grpc server.. Attempting to connect to grpc server at port: 61363 Successfully made the connection with runner with port: 61363 Validation started. Run started Starting Html Report plugin Attempting to connect to grpc server at port: 61366 Successfully made the connection with plugin with port: 61366 Starting Xml Report plugin Attempting to connect to grpc server at port: 61369 Successfully made the connection with plugin with port: 61369 Initialising suite data store.

Error Message: transport is closing Stacktrace:

Transformed SuiteResult to report structure

Error Message: Runner is not Alive Stacktrace:

Error occurred while waiting for runner process to finish. Error : exit status 1 Successfully generated html-report to => C:\index.html

01-02-2021 11:30:27.449 [Gauge] [DEBUG] Created gauge_screenshots_dir at 
01-02-2021 11:30:27.452 [Gauge] [DEBUG] Plugin python is already installed.
01-02-2021 11:30:27.453 [Gauge] [DEBUG] Plugin html-report is already installed.
01-02-2021 11:30:27.453 [Gauge] [DEBUG] Plugin xml-report is already installed.
01-02-2021 11:30:27.454 [Gauge] [DEBUG] Plugin screenshot is already installed.
01-02-2021 11:30:27.454 [Gauge] [DEBUG] Parsing started.
01-02-2021 11:30:27.454 [Gauge] [DEBUG] Started concepts parsing.
01-02-2021 11:30:27.458 [Gauge] [DEBUG] 3 concepts parsing completed.
01-02-2021 11:30:27.459 [Gauge] [DEBUG] Started specifications parsing.
01-02-2021 11:30:27.460 [Gauge] [DEBUG] 3 specifications parsing completed.
01-02-2021 11:30:27.460 [Gauge] [DEBUG] Parsing completed.
01-02-2021 11:30:28.137 [python] [INFO] Python: 3.9.1
01-02-2021 11:30:28.137 [python] [DEBUG] Loading step implementations from  dirs.
01-02-2021 11:30:28.335 [python] [DEBUG] Starting grpc server..
01-02-2021 11:30:28.339 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 61585
01-02-2021 11:30:28.341 [Gauge] [DEBUG] Successfully made the connection with runner with port: 61585
01-02-2021 11:30:28.341 [Gauge] [DEBUG] Validation started.
01-02-2021 11:30:28.358 [Gauge] [DEBUG] Validation completed.
01-02-2021 11:30:28.358 [Gauge] [DEBUG] Run started
01-02-2021 11:30:28.359 [Gauge] [DEBUG] Starting Html Report plugin
01-02-2021 11:30:28.391 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 61588
01-02-2021 11:30:28.392 [Gauge] [DEBUG] Successfully made the connection with plugin with port: 61588
01-02-2021 11:30:28.393 [Gauge] [DEBUG] Starting Xml Report plugin
01-02-2021 11:30:28.425 [Gauge] [DEBUG] Attempting to connect to grpc server at port: 61591
01-02-2021 11:30:28.426 [Gauge] [DEBUG] Successfully made the connection with plugin with port: 61591
01-02-2021 11:30:28.427 [Gauge] [DEBUG] Initialising suite data store.
01-02-2021 11:30:28.435 [python] [CRITICAL] Exception occurred while loading step implementations from file: step_impl\customer.py.
01-02-2021 11:30:28.439 [Gauge] [ERROR] Error Message: transport is closing
01-02-2021 11:30:28.439 [Gauge] [ERROR] Stacktrace: 
01-02-2021 11:30:28.440 [html-report] [DEBUG] Transformed SuiteResult to report structure
01-02-2021 11:30:28.440 [Gauge] [ERROR] Error Message: Runner is not Alive
01-02-2021 11:30:28.440 [Gauge] [ERROR] Stacktrace: 
01-02-2021 11:30:28.455 [Gauge] [ERROR] Error occurred while waiting for runner process to finish.
Error : exit status 1
01-02-2021 11:30:28.460 [html-report] [INFO] Successfully generated html-report to => 
01-02-2021 11:30:28.460 [html-report] [DEBUG] Done generating HTML report using theme from C:\Users\bma\AppData\Roaming\gauge\plugins\html-report\4.0.12\themes\default
01-02-2021 11:30:28.462 [xml-report] [INFO] Successfully generated xml-report to =>
01-02-2021 11:30:28.462 [Gauge] [DEBUG] Sending kill message to Html Report plugin.
01-02-2021 11:30:28.462 [Gauge] [DEBUG] Sending kill message to Xml Report plugin.
01-02-2021 11:30:28.805 [Gauge] [DEBUG] Checking updates...
01-02-2021 11:30:28.813 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/html-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
01-02-2021 11:30:29.724 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/python?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
01-02-2021 11:30:29.965 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/screenshot?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
01-02-2021 11:30:30.207 [Gauge] [DEBUG] Downloading https://downloads.gauge.org/plugin/xml-report?l=python&p=html-report,python,screenshot,xml-report&o=windows&a=amd64
01-02-2021 11:30:30.437 [Gauge] [ERROR] Failed to kill Runner: rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing dial tcp 127.0.0.1:61585: connectex: No connection could be made because the target machine actively refused it."
01-02-2021 11:30:30.438 [Gauge] [INFO] Specifications:	0 executed	0 passed	0 failed	0 skipped
01-02-2021 11:30:30.438 [Gauge] [INFO] Scenarios:	0 executed	0 passed	0 failed	0 skipped
01-02-2021 11:30:30.438 [Gauge] [INFO] 
Total time taken: 80ms

Expected behavior A clear and concise description of what you expect to happen.

Screenshots

Versions:

gauge -v

Gauge version: 1.1.7
Commit Hash: 5d86b72

Plugins
-------
html-report (4.0.12)
python (0.3.14)
screenshot (0.0.1)
xml-report (0.2.3)
  • Windows 10.0.18363
  • Runner info Python 3.9.1
  • VS Code (or just running in command line)

Additional context Add any other context about the problem here.

yinzhenzhixin avatar Feb 01 '21 03:02 yinzhenzhixin

I tried to uninstall gauge, python, but no luck. I also confirmed that the timeout values have been predefined in the gauge.properties. It's very despaired since the issue blocks any tests running on my side, could it be possible to give it a look?

yinzhenzhixin avatar Feb 01 '21 03:02 yinzhenzhixin

As I looked into the logs, looks like there are something wrong with my python scripts, because there is a sign in the log '[python] [CRITICAL]'. However, where is the detailed log and stacktrace for the error? I've no idea how to figure it out. Debug is not working as well

yinzhenzhixin avatar Feb 03 '21 08:02 yinzhenzhixin

This might be a silly question, but do you have all the necessary import statements related to gauge? If yes, are you sure your script doesn't have any bugs/typos? The problem is most likely to do with your customer.py file. I had the same error and I had a typo in my import statement. Fixed it and it worked fine. You could try running the example spec (vowel count) alone (move the customer.py file from your step_implementation directory before running) and see if you're seeing the same error. If you're not, you know where the problem is.

icanthinkformyself avatar Feb 09 '21 23:02 icanthinkformyself

This might be a silly question, but do you have all the necessary import statements related to gauge? If yes, are you sure your script doesn't have any bugs/typos? The problem is most likely to do with your customer.py file. I had the same error and I had a typo in my import statement. Fixed it and it worked fine. You could try running the example spec (vowel count) alone (move the customer.py file from your step_implementation directory before running) and see if you're seeing the same error. If you're not, you know where the problem is.

Thanks, If so, why not show up the error in the console or gauge log? I mean, for now there is just a general log as "[python] [CRITICAL] Exception occurred while loading step implementations from file: step_impl\customer.py", how do I figure out the actual and detailed error information?

yinzhenzhixin avatar Feb 18 '21 02:02 yinzhenzhixin

I think this is something that gauge-python should handle. There have been similar reports where gauge is not reporting import errors. The errors are usually fixable by the users by making changes to the code, however Gauge should try and make it easy to figure out what and where needs fixing.

sriv avatar Feb 27 '21 16:02 sriv

is there any clues or workarounds for this issue? It impacts our automation testing tasks very much indeed

yinzhenzhixin avatar Mar 08 '21 02:03 yinzhenzhixin

Have you tried downgrading python to version 3.8 instead of 3.9?

zabil avatar Mar 09 '21 08:03 zabil

@zabil I tried with python 3.8.8 but got the same problem, any other clues please?

yinzhenzhixin avatar Mar 17 '21 05:03 yinzhenzhixin

@zabil @yinzhenzhixin Did you guys solve this issue? Running into the same error with this version: Gauge version: 1.4.1 Plugins flash (0.0.2) html-report (4.1.2) python (0.3.17) screenshot (0.1.0) xml-report (0.2.3)

I'm on Python version 3.9.7.

Help!! :) Thank you!

alinagolovin90 avatar Sep 27 '21 19:09 alinagolovin90

@alinagolovin90 - can you check your project's gauge.log to see what error is being reported there?

When this issue was reported, gauge-python was not bubbling up the cause of error that caused the step implementation load to fail. This was fixed after this issue was reported, so you should ideally now see what is causing the error.

The problem could be that there's some unresolved references in your step implementation that is causing gauge-python to crash when it cannot load a file.

sriv avatar Sep 28 '21 03:09 sriv

@alinagolovin90 - can you check your project's gauge.log to see what error is being reported there?

When this issue was reported, gauge-python was not bubbling up the cause of error that caused the step implementation load to fail. This was fixed after this issue was reported, so you should ideally now see what is causing the error.

The problem could be that there's some unresolved references in your step implementation that is causing gauge-python to crash when it cannot load a file.

It works! Don`t see the output, but the gauge.log

DirkZhao avatar Nov 16 '21 02:11 DirkZhao