Skip to main content

Common Errors

There are a few error messages that you might run across while setting up the development environment that seem cryptic, but generally have very straight forward solutions.

docker.sock Error

Error Message:

request returned Internal Server Error for API route and version
http://%2FUsers%2Fexample%2F.docker%2Frun%2Fdocker.sock/v1.24/containers/json?all=1&filters=%7B%22label%22%3A%7B%22com.docker.compose.config-hash%22%3Atrue%2C%22com.docker.compose.project%3Dorganic-dev-core%22%3Atrue%7D%7D,
check if the server supports the requested API version

Solution: Restart the Docker daemon on your computer. Easiest route is by clicking on the Docker whale icon in your taskbar and clicking Restart.

mysql-dev.cnf Error

Error Message:

Error response from daemon: Mounts denied:
The path /opt/homebrew/lib/python3.11/site-packages/organic_dev_core/config/mysql8/mysql-dev.cnf is not shared from the host and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> Resources -> File Sharing.

Solution:

This happens if you are trying to use a globally installed copy of the organic-cli.

To resolve it, make sure to run a venv copy of it by starting up the venv in the directory you are running it from:

python3 -m venv $HOME/organic-dev-venv && source $HOME/organic-dev-venv/bin/activate

mysqli_real_connect Error

Error Message:

Warning: mysqli_real_connect(): (HY000/2002): No such file or directory in
/var/www/html/web/wp/wp-includes/class-wpdb.php on line 2022

Solution:

Make sure that you have the .env file created out of the .env.example file and uncommented the following line if you are on a Mac:

DOCKER_HOST=host.docker.internal

Once you've done this, restarting the app with organic-cli up should work.

GraphQL Document Validation failed

Error Message:

    ✖ GraphQL Document Validation failed with 1 errors;
Error 0: Unknown type "AcfArticleListBlock". Did you mean "AcfArticleBlock", "AcfArticleGridBlock", "AcfArticlesSliderBlock", "CoreListBlock", or "CorePageListBlock"?
at /Users/justindemaris/Documents/Engineering/thebrighterside.news/frontend/node_modules/@orgnc/core/lib/wordpress/api/fragments/blocks/acfArticleListBlockFragment.js:2:43

Solution: This normally shows up when you are trying to run yarn dev, but could appear at another time.

  1. There are a few things possibly at play here. Firstly, you might be behind on your orgnc/organic-content dependency on the Wordpress side, so make sure you update that to at least version 2.0.115.
  2. After updating it, make sure that you log into the CMS and go to GraphQL Gutenberg and click "Update Registry" to ensure that your CMS instance has the latest GraphQL registry for all blocks.
  3. Update the JavaScript file in the frontend that contains a cached export of the Block Registry by running yarn run graphql:fetch
  4. Now you can run yarn dev, which calls yarn run graphql:codegen under the hood, and it should load!