Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModelPolisher cannot find any relations in ADB. #56

Closed
codekaust opened this issue Jul 24, 2019 · 10 comments

Comments

@codekaust
Copy link
Collaborator

commented Jul 24, 2019

Current code in feat/annotatedb is not able to find relations in adb.
You can recreate error by building lightJar and running these commands:

docker build -t bigg:latest ./docker/bigg_docker/
docker build -t adb:latest ./docker/adb_docker/
docker run --name adb -p 1013:5432 -d adb:latest && docker run --name bigg -p 1310:5432 -d bigg:latest
java -jar ./target/ModelPolisher-noDB-1.7.jar --input=<input> --output=<output> --annotate-with-bigg=true --bigg-host=0.0.0.0 --bigg-port=1310 --add-adb-annotations=true --adb-host=0.0.0.0 --adb-port=1013
@codekaust codekaust self-assigned this Jul 24, 2019
@draeger draeger added the bug label Jul 25, 2019
@matthiaskoenig

This comment has been minimized.

Copy link
Collaborator

commented Jul 25, 2019

@codekaust I will have a look at this in the next few hours

@matthiaskoenig matthiaskoenig self-assigned this Jul 25, 2019
@matthiaskoenig

This comment has been minimized.

Copy link
Collaborator

commented Jul 26, 2019

This is now fixed. There were problems in your dockerfile and the postgres init script.
Mainly you did not create the correct users and so on so that the database dump was not put in the container. You should always look at the logs of your containers if running in detached mode, i.e.,

docker container logs adb

Shows you what went wrong.
Also always run pg_restore with the -v or --verbose flag to make sure things work.

After creating the container your should test if you can connect to the database. I did this with
idea.sh data sources (see below)

pycharm_adb_connect

You can see the data in the docker container image
pycharm_adb_content

Also don't map the ports in the docker files! only expose what must be exposed, i.e., 5432 in case of postgres

In summary, your scripts for restoring the db did not work, this is fixed now.

@codekaust

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 26, 2019

Thank You @matthiaskoenig!
I will take care of your suggestions.

@codekaust

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 29, 2019

Above is not the solution for this issue.
REASON: ModelPolisher is querying biggdb.

@codekaust codekaust reopened this Jul 29, 2019
@matthiaskoenig

This comment has been minimized.

Copy link
Collaborator

commented Jul 29, 2019

Could you explain what the issue is? The relations are in the database, you just have to query them. If the issue is that ModelPolisher is not using the annotatedb relations then you should open a respective issue. But the relations are there and can be queried which fixes your issue description.

@codekaust

This comment has been minimized.

Copy link
Collaborator Author

commented Jul 30, 2019

Yes, the problem is not in ADB or in setting up of ADB by docker. The issue is somewhere in the connection of ModelPolisher with ADB container. I am trying to understand and resolve this issue, will update if I find anything.

@codekaust

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 2, 2019

Issue found: Here we create connector for BGGDB and here for ADB.

connector.connect() runs in each constructor but after one connector is connected(which happens for BiGGDB) the connect function for other connector is not run.

@mephenor any idea?

@codekaust

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 2, 2019

PostgreSQLConnector psqlConnect = new PostgreSQLConnector(adb_host, new Integer(adb_port), adb_user, adb_passwd != null ? adb_passwd : "", adb_dbName);
          logger.info(psqlConnect.isConnected()+"");
          adb = new AnnotateDB(psqlConnect);

2nd line gives result true. Get by adding log here.

@draeger

This comment has been minimized.

Copy link
Member

commented Aug 3, 2019

It seems to me this is a problem of ADB.

codekaust added a commit that referenced this issue Aug 5, 2019
@codekaust

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 5, 2019

No, it was a problem with SQLConnector only as I have mentioned in the above comments.

@codekaust codekaust added this to Containerization of ModelPolisher using Docker. in GSoC 2019 Aug 11, 2019
@draeger draeger closed this in e86667f Aug 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
GSoC 2019
  
Containerization of ModelPolisher us...
3 participants
You can’t perform that action at this time.