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

Errors from mega-linter runner #295

Closed
bcdady opened this issue Jan 25, 2021 · 6 comments · Fixed by #296
Closed

Errors from mega-linter runner #295

bcdady opened this issue Jan 25, 2021 · 6 comments · Fixed by #296
Labels
bug Something isn't working

Comments

@bcdady
Copy link

bcdady commented Jan 25, 2021

Describe the bug
The current v4 image is displaying python errors instead of outputting the expected table of results

To Reproduce

  1. Setup mega-linter runner locally via these instructions
  2. run npx mega-linter-runner
  • for what it may be worth, I'm getting the same error from the 'latest' / insiders image, and the few flavors I've tried
  1. See error output

Expected behavior
mega-linter completes successfully, including showing the results table, similar to the example shown at https://nvuillam.github.io/mega-linter/mega-linter-runner/

Error Output

[Text Reporter] Generated TEXT report: /tmp/lint/report/linters_logs/SUCCESS-JSON_V8R.log
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/megalinter/MegaLinter.py", line 27, in run_linters
    linter.run()
  File "/megalinter/Linter.py", line 451, in run
    reporter.produce_report()
  File "/megalinter/reporters/TextReporter.py", line 76, in produce_report
    text_report_lines += self.master.complete_text_reporter_report(self)
  File "/megalinter/linters/CSpellLinter.py", line 64, in complete_text_reporter_report
    data = json.load(json_file)
  File "/usr/local/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 33 column 5 (char 634)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/local/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/megalinter/run.py", line 15, in <module>
    linter.run()
  File "/megalinter/MegaLinter.py", line 125, in run
    self.process_linters_parallel(active_linters, linters_do_fixes)
  File "/megalinter/MegaLinter.py", line 208, in process_linters_parallel
    updated_linters = pool_result.get()
  File "/usr/local/lib/python3.8/multiprocessing/pool.py", line 771, in get
    raise self._value
json.decoder.JSONDecodeError: Expecting value: line 33 column 5 (char 634)
@bcdady bcdady added the bug Something isn't working label Jan 25, 2021
@bcdady bcdady changed the title Errors is mega-linter runner Errors from mega-linter runner Jan 25, 2021
@bcdady
Copy link
Author

bcdady commented Jan 25, 2021

@nvuillam - is there any relatively easy way to call a specific, alternative, image tag?
I presume that would be the fastest way to get mega-linter working again.

@nvuillam
Copy link
Member

I think that the problem is caused by a json error in your .cspell.json file

I'll catch it but meanwhile, open .cspell.json in your IDE, solve the typo, and mega linter should run again :)

@nvuillam
Copy link
Member

And to reply to your question, you can call any previous version of Mega-Linter with Mega-Linter runner, using parameter --release

Example: npx mega-linter-runner --release v4.24.0

But i'm afraid that you'll still have the crash while .cspell.json can not be parsed

@nvuillam
Copy link
Member

nvuillam commented Jan 25, 2021

@bcdady problem fixed :)
now even with a broken json in .cspell.json, you should see an error message but no python crash and Mega-Linter completes anyway :)

It is for the moment only available in insiders version , i'll make an official patch tonight :)

@bcdady
Copy link
Author

bcdady commented Jan 25, 2021

oh man - yep, I left a comma at the end of the .cspell.json 🤦
Thank you!!!

@nvuillam
Copy link
Member

you're welcome :)

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

Successfully merging a pull request may close this issue.

2 participants