pa11y / pa11y-dashboard

Pa11y Dashboard is a web interface which helps you monitor the accessibility of your websites
https://pa11y.org
GNU General Public License v3.0
987 stars 181 forks source link

ObjectID generation failed #302

Closed agranados0121 closed 2 years ago

agranados0121 commented 2 years ago

Based on previously resolved issues this has been already addressed but I keep running into the same errors. When running the actual task on a URL, the service generates the same error of ObjectID generation failed. One thing to note is that nothing was installed with homebrew

Actual behaviour

Starting NEW to run one-off task @ 2022-07-06T19:08:23.901Z [62c5bed69206931dbe508377] > Running Pa11y on URL https://youtube.com [62c5bed69206931dbe508377] > Launching Headless Chrome model:task:runById failed, with id: 62c5bed69206931dbe508377 Pa11y timed out (30000ms) Failed to finish task 62c5bed69206931dbe508377 ObjectID generation failed. Argument passed in must be a single String of 12 bytes or a string of 24 hex characters

Steps to reproduce

NODE_ENV=development node index.js

Environment

Running in a Ubuntu VM:

node -v v14.19.3

mongod -version db version v4.4.15 Build Info: { "version": "4.4.15", "gitVersion": "bc17cf2c788c5dda2801a090ea79da5ff7d5fac9", "openSSLVersion": "OpenSSL 1.1.0g 2 Nov 2017", "modules": [], "allocator": "tcmalloc", "environment": { "distmod": "ubuntu2004", "distarch": "x86_64", "target_arch": "x86_64" } }

josebolos commented 2 years ago

Hi @agranados0121,

The ObjectID generation message here is probably just a symptom of puppeteer failing to run Chrome successfully, as shown by the following lines in your output:

model:task:runById failed, with id: 62c5bed69206931dbe508377
Pa11y timed out (30000ms)
Failed to finish task 62c5bed69206931dbe508377

I would try to verify first that Chrome can run inside your VM. Seeing as you're running Linux you probably may want to ensure that the right dependencies are installed. If using a recent version of ubuntu you'll probably need to install libgtk-3-0, libgconf-2-4, and potentially libxss1. This is mention in the requirements section of the README, but the version of the libraries required may be different to the ones mentioned there: https://github.com/pa11y/pa11y-dashboard#requirements

If you're trying to run pa11y in a virtualised environment you may also need to pass certain flags to Chrome so it runs successfully inside the container, namely the --no-sandbox and/or --disable-setuid-sandbox. An example config with those flags could look something like:

{
    "port": 8080,
    "noindex": true,
    "readonly": false,

    "webservice": {
        "database": "mongodb://localhost",
        "host": "0.0.0.0",
        "port": 3000,
        "chromeLaunchConfig": {
            "args": [
                "--no-sandbox",
                "--disable-setuid-sandbox"
            ]
        }
    }
}

Addressing these two things should be enough to get Chrome running.

agranados0121 commented 2 years ago

Hey @josebolos,

The flags were what I was missing to get everything working. So I really appreciate the help :)