Skip to content

Commit

Permalink
Merge pull request #116 from BinaryStudioAcademy/feature/add_faq
Browse files Browse the repository at this point in the history
Add FAQ section to README.md
  • Loading branch information
aLLeXUs authored May 31, 2020
2 parents 503d065 + d6cf2de commit 52eb58f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,16 @@ MAIL_FROM_NAME="BSA Thread Admin"
```

You can debug your app with [Telescope](https://laravel.com/docs/6.x/telescope) tool which is installed already :)

## FAQ

* `Illuminate\Database\QueryException : SQLSTATE[HY000] [2002] Connection refused`
* The application can not connect to the database. Probably, `DB_HOST` environment variable is not set correctly. If you are using `docker-compose` configuration, the database host will match the database container name from `docker-compose.yml` (`mysql` in this case).
* `SQLSTATE[HY000] [1045] Access denied for user 'XXXX'@'thread-app.backend_default' (using password: YES)`
* The application can not connect to the database due to incorrect username and password. Most likely, `DB_USERNAME` or/and `DB_PASSWORD` environment variables are set incorrectly. If you are using `docker-compose` configuration, the database username and password will match the initial values `MYSQL_USER` and `MYSQL_PASSWORD` of `docker-compose.yml` (`user` and `secret` in this case). Keep in mind that these credentials are set on the first time database container running, and changing these values will not take effect unless the database data folder will be deleted and the database container will be recreated.
* `Composer could not find a composer.json file in /var/www/app. To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section`
* Most likely you are on Windows and shared folders are not configured correctly. Please, follow the instructions from [this article](https://rominirani.com/docker-on-windows-mounting-host-directories-d96f3f056a2c) in case you have `Docker for Windows`, or [this article](https://github.com/docker/toolbox/issues/796#issuecomment-582267767) in case you have `Docker Toolbox`. The easiest way is to put the project folder to the `C:\Users\` folder as it is shared by default.
* `Access to XMLHttpRequest at 'http://XX.XX.XX.XX:7777/api/v1/auth/register' from origin 'http://127.0.0.1:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.`
* Most commonly, a critical error occurred on the backend, and CORS headers were not set, so the browser will not allow this request. You can send the same request via external tools (like [Postman](https://www.postman.com/)), and you will be able to see the error in the response there. In most cases, this error occurs when a database connection can not be established AND the framework can not write to the log file.
* `ERROR: for thread-webserver Cannot start service webserver: OCI runtime create failed: container_linux.go:346:`
* Probably, you have not configured shared folders for `Docker`. It is described in one of the previous answers.

0 comments on commit 52eb58f

Please sign in to comment.