FrameNetBrasil / webtool

FrameNet Brasil Web Annotation Tool
GNU General Public License v3.0
7 stars 6 forks source link

Problem installing newer version of webtool #23

Open megamattc opened 1 year ago

megamattc commented 1 year ago

Hello Elymatos,

This is Matthew Ong again. After several months I am going back to trying to install your new version of the webtool. However, when I try to run the docker compose up command in the \webtool directory on my Mac M1 Ventura 13.3.1, I get the errors

WARN[0000] The "DOCUMENT_ROOT" variable is not set. Defaulting to a blank string. 
WARN[0000] The "PROJECT_NAME" variable is not set. Defaulting to a blank string. 
WARN[0000] The "WWW_PORT" variable is not set. Defaulting to a blank string. 
WARN[0000] The "WS_PORT" variable is not set. Defaulting to a blank string. 
1 error(s) decoding:

* error decoding 'Volumes[0]': invalid spec: :/var/www/html: empty section between colons

I don't know if this is a basic error, or how to handle this. Do you know what I should do?

elymatos commented 1 year ago

Hi Matthew , We are trying to simplify the installation (and use) of webtool, so thanks for your contact! You need to copy the .env.dist file to .env - we need to write this in the readme :-) Ely

megamattc commented 1 year ago

Hello,

I followed your instructions and then followed most of the instructions in the readme file (following the older discussion thread associated with the README.md instructions for the 3.6.1) to run the composer, although I think I still got the message AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.19.0.3. Set the 'ServerName' directive globally to suppress this message.

I imported the mysql dump into MariaDB as before. However, it is not clear if I need to update the webtool/apps/webtool/conf/conf.php or what to update since the new version of the file is very different from the 3.6.1 version. Similarly, I do not know how I should 'update' the /webtool/.env file. When I open my browser to http://localhost:8001/ I just get the following error page

Screenshot 2023-08-19 at 9 49 32 PM

Can you please help?

Matt

elymatos commented 1 year ago

Hi Matthew , As I said we are trying to simplify the installation :-) As you have created the MySQL/MariaDb database (based on the dump file), you need to specify the database data at .env file, before build and run the docker container. In the .env file change the values to match your installation (the conf.php we read the enviroment vars, so no need to edit the conf.php manually):

Database webtool

DB_NAME=webtool_db DB_HOST=db_server DB_PORT=3306 DB_USER=db_user DB_PASS=db_pass

Thnaks, Ely

megamattc commented 1 year ago

Thanks Ely.

Do you know where I would find the information from my installation (I'm not sure what that means) to substitute for the values of the .env file?

DB_NAME=webtool_db
DB_HOST=db_server
DB_PORT=3306
DB_USER=db_user
DB_PASS=db_pass

Matt

elymatos commented 1 year ago

Hi Matthew , This env vars are about your local MySQL/MariaDb installation. If you have restored the database dump, then you have a database server running. You just need to write the credentials:

DB_NAME=webtool_db  // this is the database name - from restored backup it will be webtool_db unless you have changed it.
DB_HOST=db_server // the host name or ip_address where the database server is running
DB_PORT=3306 // the TCP port of database server
DB_USER=db_user // the username you have used to create the database
DB_PASS=db_pass // the password you have used to cresate the database

Thanks, Ely

megamattc commented 1 year ago

Hi Ely,

I think I have made the necessary changes to the .env file (e.g. making DB_HOST=localhost). However when I run docker compose up -d I get the following errors:

Screenshot 2023-08-21 at 6 56 40 PM

My machine is a Mac M1. Does this mean I need to find a different docker container from the one built by your composer script? I am not sure what the above means.

Matt

elymatos commented 1 year ago

Hi Matthew , We have reproduced the installation process from start here, using a Mac with Ventura OS, and we weren't able to reproduce the problem. It seems it is a very specific problem of Docker at Mac, not related to Webtool. Please, try to reinstall Docker on Mac and verify if the problem persists. Thanks, Ely

megamattc commented 1 year ago

Hello,

I uninstalled my current version of Docker and installed the newest version for my M1 Mac and followed the installation page's recommendation to install Rosetta 2 for such machines. However, doing that gave a similar error message to the original one I showed you:

Screenshot 2023-08-22 at 5 02 01 PM

And I still get the 'Application Error' page when I point my browser to http://localhost:8001/. I believe my database is set up properly:

1.) I edited the .env file in \webtools to include:

DB_NAME=webtool_db 
DB_HOST=localhost
DB_PORT=3306
DB_USER=root // used to create the database webtool_db
DB_PASS=******** // password used to create the database

2.) I changed my MariaDB my.cnf file so that lower_case_table_names=1

3.) I check that the webtool_db is loaded in MariaDB using command USE webtool_db

4.) I then run docker compose up -d in \webtools directory.

Perhaps it would be easier to to arrange a Zoom meeting with you or someone else to handle these issues definitively?

Matt

elymatos commented 1 year ago

Hi Matthew , It is necessary to change DB_HOST=localhost

Webtool is running "inside" the container. The container has a different ip address. So you need to set DB_HOST with the ip address from your machine (the host) where docker is running.

Ely

megamattc commented 1 year ago

Hi Ely,

I tried installing things on another Mac, with an Intel chip, and it did not encounter the errors regarding platform incompatibility I showed above. However I am not sure which value I should use for the IP address corresponding to the container. Using the instructions found at https://kodekloud.com/blog/get-docker-container-ip/, I used the docker inspect fnbr-webtool command to view the following configuration information: Screen Shot 2023-08-23 at 6 29 03 PM

From this it seems the IP address should be 172.18.02. However, when I use that value in .env:


# Database webtool
DB_NAME=webtool_db
DB_HOST=172.18.0.2
DB_PORT=3306
DB_USER=root
DB_PASS=******

But when I point my browser again to http://localhost:8001/, I still get the 'application error' message.

Do you know what is still going wrong?

Matt

elymatos commented 1 year ago

Hi Matthew , great news you have got to run docker without errors. If the database server is running at same host you are running docker container, you can use at .env:

DB_HOST=host.docker.internal

Thanks, Ely

megamattc commented 1 year ago

Hi Ely,

I did manage now to get to the login screen of the webtool on my browser:

Screenshot 2023-08-24 at 11 39 43 AM

But when I try to input the user and password which I used in MariaDB to create the webtool_db database (from the .env file):

DB_USER=root DB_PASS=*****

I cannot login. Nor does using user=admin/pass=admin like the instructions say. Without the login I only get a basic screen:

Screenshot 2023-08-24 at 11 41 59 AM

Do you know what is going on?

Matt

megamattc commented 1 year ago

Hi Ely,

Another note: The values I put for DB_USER and DB_PASS (as indicated above) are correct, since when I changed them to other values I could no longer get the webtool to appear at localhost:8001. When I look at the tutorial videos the demonstrator assumes I have logged in already to a test site (the address http://test.framenetbr.ufjf.br/ just gives the application error) 'as an administrator', and the tool shows more functionality than what I see on my browser. So the login/password on the login page must be different from my DB_USER and DB_PASS values.

Matt

elymatos commented 1 year ago

Hi Matthew, User 'admin' password 'admin' is the default user recorded at the database dump distributed with webtool (and I guess you have used it to create your local database). If you are able to access the database, please check the table "user" and verify if the user "admin" is created. The field "passMD5" is a MD5 of the user password and you can alter it directly in the database if need:

update passMD5 = md5('a new password') where login='admin';

Thanks, Ely

megamattc commented 1 year ago

Hi Ely,

I don't understand why, but the 'admin' user does not seem to be associated with the database:

Screenshot 2023-08-30 at 5 06 29 PM

Does this not mean that the user 'webtool' should have access to the webtool with password '098f6...'? But when I tried this login info I still couldn't log in on the webtool...

Matt

megamattc commented 1 year ago

Hello again Ely,

I don't know why, but when I deleted the database in MariaDB and recreated it from the dump file, the user table became:

Screenshot 2023-08-30 at 5 46 01 PM

I don't know if this change depends on the values in the .env file, as those are still set to DB_USER=root, DB_PASS=*****. For some strange reason, this time when I tried to open the login screen on my browser, I guess clicking on the 'home' link took me to the login page, where I somehow was immediately taken to the version of the webtool as shown in the tutorial videos.

I don't understand the order in which the database creation, setting of .env values, and login screen depend. I have always been using the command mariadb -u root -p + password to login to Mariadb (other things don't work on my machine), so it would seem that user=root, pass=password are the access values assigned to webtool_db. Thus I don't understand why the user table of webtool_db would show 'admin'. Perhaps the .env file specifies the values for the login screen on the browser, which match what MariaDB assigns to the webtool_db (root/password)? But then what role does the 'user=admin' value from the user table itself play?

Matt

elymatos commented 1 year ago

Hi Matthew, One thing is the user/pass to access the database (this is, to access the MySQL/MariaDb server). These are the user/pass recorded at the .env files and that must be used to create the database (or restore a fresh dump). Another different thing is the user/pass for the application (the first login screen you see when you access webtool). These users are record inside the table "user" (inside the database). Generally you have just one user/pass to MySQL/MariaDb server, but the application can have many users. So, now that you had recreated the database and see that the user "admin" exists in the table, you must use admin/admin to login. Thanks, Ely