Repository navigation
Description
When I'm try to create an account it throws me an JSON responds
{"message":"SQLSTATE[HY000] [2002] php_network_getaddresses: getaddrinfo failed: Name or service not known","code":2002,"file":"/usr/share/nginx/html/app/init.php","line":68,"trace":[{"file":"/usr/share/nginx/html/app/init.php","line":68,"function":"__construct","class":"PDO","type":"->","args":["mysql:host=mariadb;dbname=appwrite;charset=utf8mb4","root","password",{"1002":"SET NAMES utf8mb4","2":5}]},{"file":"/usr/share/nginx/html/vendor/utopia-php/registry/src/Registry/Registry.php","line":72,"function":"{closure}","args":[]},{"file":"/usr/share/nginx/html/app/app.php","line":196,"function":"get","class":"Utopia\Registry\Registry","type":"->","args":["db"]},{"function":"{closure}","args":[]},{"file":"/usr/share/nginx/html/vendor/utopia-php/abuse/src/Abuse/Adapters/TimeLimit.php","line":263,"function":"call_user_func","args":[{}]},{"file":"/usr/share/nginx/html/vendor/utopia-php/abuse/src/Abuse/Adapters/TimeLimit.php","line":159,"function":"getPDO","class":"Utopia\Abuse\Adapters\TimeLimit","type":"->","args":[]},{"file":"/usr/share/nginx/html/vendor/utopia-php/abuse/src/Abuse/Adapters/TimeLimit.php","line":233,"function":"count","class":"Utopia\Abuse\Adapters\TimeLimit","type":"->","args":["url:localhost/v1/auth/register,ip:172.18.0.1",1567558800]},{"file":"/usr/share/nginx/html/app/app.php","line":216,"function":"remaining","class":"Utopia\Abuse\Adapters\TimeLimit","type":"->","args":[]},{"function":"{closure}","args":[]},{"file":"/usr/share/nginx/html/vendor/utopia-php/framework/src/App.php","line":387,"function":"call_user_func_array","args":[{},[]]},{"file":"/usr/share/nginx/html/app/app.php","line":793,"function":"run","class":"Utopia\App","type":"->","args":[{},{}]},{"file":"/usr/share/nginx/html/public/index.php","line":27,"args":["/usr/share/nginx/html/app/app.php"],"function":"include"}],"version":"latest"}
Activity
eldadfux commentedon Sep 4, 2019
Hi this seems like your Appwrite instance is having trouble connecting with the MariaDB container.
To try and debug what failed, more information is needed:
Whats is your docker version?
Check your containers status using 'docker ps' command and paste it here.
If any of your Appwrite containers is down please paste the container log in here.
As this seems a database issue, please login into your mariadb container and check if you have the 'appwrite' database set up with all Appwrite tables. You can do so using the docker command: 'docker exec -it [container-id] bash', inside the container use: 'mysql -u root -p' and type your container password (default is: 'password'). In the mysql client check the output of: 'USE appwrite; SHOW FULL TABLES'.
jsaberon commentedon Sep 4, 2019
Docker Version: Docker version 19.03.1, build 74b1e89
docker ps
I'm using Windows and I cant read the logs. because it is encrypted.
Please comment if you need more information
eldadfux commentedon Sep 4, 2019
From the logs you posted its seems your mariadb container has trouble starting ('Restarting (1) 19 seconds ago').
The only way to debug this is to get the mariadb logs, don't really know why you are having trouble to get them. Do you have any error message?
A way to try and bypass the problem is to delete your storage directory, your appwrite/mariadb container and image and run the 'docker-compose up -d' command in the appwrite-ce working directory.
Another issue is that in your logs you posted only 4 containers, please make sure all the containers listed in the docker-compose.yml file are up and running.
jsaberon commentedon Sep 5, 2019
I change my maria db container port 3306:3306 to 3306:5000 and I encountered the same error
This is the new docker ps:
eldadfux commentedon Sep 5, 2019
When changing mariadb port number make sure to let the 'appwrite' container know about the new port with the '_APP_DB_PORT' env variable.
it should look like this:
Another thing to make sure is that the port was really the problem. Did you get error from docker indicating the port is already taken? As I wrote before, the best way to debug a container that keeps restarting is to check for its logs like this:
jsaberon commentedon Sep 5, 2019
I change the
ymlfile to the configuration above and rundocker-compose up -dand the maria db still restartingdocker ps
I try to run
docker logs [mariadb-container-id]but the result isError: No such container: [mariadb-container-id]eldadfux commentedon Sep 5, 2019
you should change the [mariadb-container-id] with your container id, from looking at your logs this:
57dca687126b
jsaberon commentedon Sep 5, 2019
this is the logs from maria db
eldadfux commentedon Sep 5, 2019
OK great, now we have a lot more information. This definitely seems like MariaDB/MySQL issue.
Solution 1:
I am not completely sure about this, but I found it online and it seems related to your issue:
https://manage.accuwebhosting.com/knowledgebase/2318/How-to-Fix-MySQL-Error-Plugin-andsharp039InnoDBandsharp039-registration-as-a-STORAGE-ENGINE-failed.html
Solution 2
If still having trouble solving this, I would try to remove the mariadb container, image, clean storage and run stack again.
Something like this:
jsaberon commentedon Sep 5, 2019
This is the new error. I don't know how to access the pertaining folder in this error or where I can find it.
Almoullim commentedon Sep 10, 2019
@jdorfman
I just had the same issue. Seems like as of MariaDB 10.3+ this issue happens when you bind a volume to
/var/lib/mysqlon Windows using Hyper-V. For now, the only solutions seem to use MariaDB 10.2 or older.Clone this repo https://github.com/appwrite/docker-mariadb.git in your
appwrite-celike sogo into the cloned repo directory and change the
Dockerfilecontents to thisFROM mariadb:10.4toFROM mariadb:10.2in your
docker-compose.yamlfile:change this:
to this:
@eldadfux maybe you could include all of this untill the issue is fixed on windows?
eldadfux commentedon Sep 10, 2019
@Almoullim yes, sure.. but do you have any reference to the original issue in windows so I will be able to track it for changes and upgrade back when fixed?
Almoullim commentedon Sep 10, 2019
@eldadfux Don't have anything that you can track, many issues around in the docker-library/mariadb repo opening and closing about this, most of the information can be found here MariaDB/mariadb-docker#95 and here the pull request that enabled passing the flag MariaDB/mariadb-docker#168
passing the flag should be the current fix
--innodb-flush-method=fsync, downgrading shouldn't be necessary but in my case it was16 remaining items
Merge pull request appwrite#6 from utopia-php/feat-add-lynx
Merge pull request appwrite#6 from AmreshSinha/doc-2087-contributing-…
Merge pull request appwrite#6 from kodumbeats/feat-validator-gettype
Merge pull request appwrite#6 from utopia-php/fix-round-robin
Merge pull request appwrite#6 from utopia-php/feat-throw-on-no-scheme
Merge pull request appwrite#6 from utopia-php/fix-options
fix(schema): address review feedback on ClickHouse skip indexes
Merge pull request appwrite#6 from utopia-php/feat-clickhouse-skip-in…
Merge pull request appwrite#6 from utopia-php/chore-improvements
Merge pull request appwrite#6 from utopia-php/feat-fastly-domain-key
Add balancer cache adapter with typed CDN options
Merge pull request appwrite#6 from utopia-php/feat/usage-intervals
Merge pull request appwrite#6 from TorstenDittmann/fix-pdo-type
Merge pull request appwrite#6 from niwla23/patch-1
Revert per-resource wrap rethrow; record and continue