darrenjennings / algolia-docsearch-action

runs the docsearch scraper and updates an index
29 stars 15 forks source link

Doesn't work, you get a run command not found error? #6

Open elucidsoft opened 2 years ago

elucidsoft commented 2 years ago

This does not appear to work, you get a "run command not found" error. I can't seem to figure out why.

darrenjennings commented 2 years ago

Sorry this isn't enough information to go off of. Can you provide a reproduction repo?

elucidsoft commented 2 years ago

I reverted back to the commit prior to making it run faster and it worked fine. I stuck with that in my own fork.

artt commented 2 years ago

Same issue. Will try @elucidsoft's fix.

guzhongren commented 2 years ago

Still error, it does not make sense, the pipeline should be broken when there is an error.

this is my error, maybe we can enhance this issue

Collecting typing-extensions>=3.6.4
  Downloading typing_extensions-4.0.1-py3-none-any.whl (22 kB)
Collecting zipp>=0.5
  Downloading zipp-3.6.0-py3-none-any.whl (5.3 kB)
Installing collected packages: zipp, typing-extensions, six, platformdirs, importlib-resources, importlib-metadata, filelock, distlib, virtualenv-clone, virtualenv, certifi, pipenv
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: pip.pypa.io/warnings/venv
Successfully installed certifi-2021.10.8 distlib-0.3.4 filelock-3.4.1 importlib-metadata-4.8.3 importlib-resources-5.4.0 pipenv-2021.11.23 platformdirs-2.4.0 six-1.16.0 typing-extensions-4.0.1 virtualenv-20.13.0 virtualenv-clone-0.5.7 zipp-3.6.0
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Installing dependencies from Pipfile.lock (aabb41)...
Traceback (most recent call last):
  File "docsearch", line 5, in <module>
    run()
  File "/github/workspace/docsearch-scraper/cli/src/index.py", line 161, in run
    exit(command.run(sys.argv[2:]))
  File "/github/workspace/docsearch-scraper/cli/src/commands/run_config.py", line 21, in run
    return run_config(args[0])
  File "/github/workspace/docsearch-scraper/cli/../scraper/src/index.py", line 33, in run_config
    config = ConfigLoader(config)
  File "/github/workspace/docsearch-scraper/cli/../scraper/src/config/config_loader.py", line 72, in __init__
    for key, value in list(data.items()):
AttributeError: 'list' object has no attribute 'items'
🚀 Successfully indexed and uploaded the results to Algolia
baptisteArno commented 2 years ago

Same issue: https://github.com/baptisteArno/typebot.io/runs/6402299187?check_suite_focus=true

What's the fix?

webbertakken commented 2 years ago

So it's erroring one two separate issues:

And yet the workflow marks as succeeded.

Successfully installed certifi-2022.5.18.1 distlib-0.3.4 filelock-3.4.1 importlib-metadata-4.8.3 importlib-resources-5.4.0 pipenv-2022.4.8 platformdirs-2.4.0 six-1.16.0 typing-extensions-4.1.1 virtualenv-20.14.1 virtualenv-clone-0.5.7 zipp-3.6.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
WARNING: You are using pip version 21.2.4; however, version 21.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
Installing dependencies from Pipfile.lock (aabb41)...
Traceback (most recent call last):
  File "/github/workspace/docsearch-scraper/cli/../scraper/src/config/config_loader.py", line 101, in _load_config
    data = json.loads(config, object_pairs_hook=OrderedDict)
  File "/usr/local/lib/python3.6/json/__init__.py", line [36](https://github.com/game-ci/documentation/runs/6514527906?check_suite_focus=true#step:4:37)7, in loads
    return cls(**kw).decode(s)
  File "/usr/local/lib/python3.6/json/decoder.py", line 3[39](https://github.com/game-ci/documentation/runs/6514527906?check_suite_focus=true#step:4:40), in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.6/json/decoder.py", line 3[57](https://github.com/game-ci/documentation/runs/6514527906?check_suite_focus=true#step:4:58), in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "docsearch", line 5, in <module>
    run()
  File "/github/workspace/docsearch-scraper/cli/src/index.py", line 1[61](https://github.com/game-ci/documentation/runs/6514527906?check_suite_focus=true#step:4:62), in run
    exit(command.run(sys.argv[2:]))
  File "/github/workspace/docsearch-scraper/cli/src/commands/run_config.py", line 21, in run
    return run_config(args[0])
  File "/github/workspace/docsearch-scraper/cli/../scraper/src/index.py", line 33, in run_config
    config = ConfigLoader(config)
  File "/github/workspace/docsearch-scraper/cli/../scraper/src/config/config_loader.py", line 69, in __init__
    data = self._load_config(config)
  File "/github/workspace/docsearch-scraper/cli/../scraper/src/config/config_loader.py", line 106, in _load_config
    raise ValueError('CONFIG is not a valid JSON')
ValueError: CONFIG is not a valid JSON
🚀 Successfully indexed and uploaded the results to Algolia

Note that it even prints the message with the rocket.

Seeing the comments above, this doesn't seem to work for over half a year now. Would it make sense to either fix it or remove it from the marketplace?