explainshell icon indicating copy to clipboard operation
explainshell copied to clipboard

Having trouble importing man pages

Open deoxykev opened this issue 5 years ago • 1 comments

Trying to import a gunzip'd man page, but it is giving me this error.

(i'm running in docker btw)

root@244ca629809b:/opt/webapp# PYTHONPATH=. python explainshell/manager.py --log info ./manpages/1/echo.1.gz
INFO:explainshell.store:creating store, db = 'explainshell', host = 'mongodb://db'
INFO:explainshell.algo.classifier:train on 994 instances
INFO:explainshell.manager:handling manpage echo (from /opt/webapp/manpages/1/echo.1.gz)
INFO:explainshell.store:looking up manpage in mapping with src 'echo'
INFO:explainshell.manpage:executing '/opt/webapp/tools/w3mman2html.cgi local=%2Fopt%2Fwebapp%2Fmanpages%2F1%2Fecho.1.gz'
CRITICAL:explainshell.manager:uncaught exception when handling manpage /opt/webapp/manpages/1/echo.1.gz
Traceback (most recent call last):
  File "explainshell/manager.py", line 201, in <module>
    sys.exit(main(args.files, args.db, args.host, args.overwrite, args.drop, args.verify))
  File "explainshell/manager.py", line 183, in main
    added, exists = m.run()
  File "explainshell/manager.py", line 113, in run
    m = self.process(ctx)
  File "explainshell/manager.py", line 71, in process
    self._read(ctx, frunner)
  File "explainshell/manager.py", line 40, in _read
    ctx.manpage.read()
  File "/opt/webapp/explainshell/manpage.py", line 185, in read
    self._text = subprocess.check_output(cmd, stderr=devnull, env=ENV)
  File "/usr/local/lib/python2.7/subprocess.py", line 223, in check_output
    raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/opt/webapp/tools/w3mman2html.cgi', 'local=%2Fopt%2Fwebapp%2Fmanpages%2F1%2Fecho.1.gz']' returned non-zero exit status 127

deoxykev avatar May 04 '20 06:05 deoxykev

I believe this is caused by an issue in the w3mman2html.cgi script. The defined(%PATH) appears to be causing issues.

https://github.com/timothybrush/explainshell/commit/245cfcc8413fa903eb6ca7c008340bdcb5d543f4#diff-d89ea12a84ac40753aa67473e05aa589a5f552f7b0d2dbc70ef98b9cd81a42bb

timothybrush avatar Jun 14 '21 05:06 timothybrush