archesproject / arches-for-science

Arches for Science
13 stars 9 forks source link

AFS 7.x installation fails for different reasons #1566

Open Gianluke opened 6 months ago

Gianluke commented 6 months ago

Hi all, I trying to install AFS (based on Arches 7.x version) but every attempt I make fails (on dedicate Ubuntu 20.04 LTS VM with "scripted dependency" installation).

First try:

after clone the repo (or installing by "pip install arches-for-science" command), the setup_db task failed with error:

Traceback (most recent call last): File "/home/arches/arches-for-science/digilab/manage.py", line 30, in execute_from_command_line(sys.argv) File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/init.py", line 442, in execute_from_command_line utility.execute() File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/init.py", line 436, in execute self.fetch_command(subcommand).run_from_argv(self.argv) File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv self.execute(*args, cmd_options) File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute output = self.handle(*args, *options) File "/home/arches/ENV/lib/python3.10/site-packages/arches/management/commands/setup_db.py", line 54, in handle self.setup_db(development=options["dev"]) File "/home/arches/ENV/lib/python3.10/site-packages/arches/management/commands/setup_db.py", line 192, in setup_db management.call_command("es", operation="delete_indexes") File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/init.py", line 194, in call_command return command.execute(args, defaults) File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute output = self.handle(args, options) File "/home/arches/ENV/lib/python3.10/site-packages/arches/management/commands/es.py", line 167, in handle self.delete_indexes(name=options["name"]) File "/home/arches/ENV/lib/python3.10/site-packages/arches/management/commands/es.py", line 297, in delete_indexes delete_terms_index() File "/home/arches/ENV/lib/python3.10/site-packages/arches/app/search/mappings.py", line 100, in delete_terms_index se.delete_index(index=TERMS_INDEX) File "/home/arches/ENV/lib/python3.10/site-packages/arches/app/search/search.py", line 118, in delete_index return self.es.options(ignore_status=[400, 404]).indices.delete(kwargs) File "/home/arches/ENV/lib/python3.10/site-packages/elasticsearch/_sync/client/utils.py", line 446, in wrapped return api(args, **kwargs) File "/home/arches/ENV/lib/python3.10/site-packages/elasticsearch/_sync/client/indices.py", line 736, in delete return self.perform_request( # type: ignore[return-value] File "/home/arches/ENV/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 423, in perform_request return self._client.perform_request( File "/home/arches/ENV/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 271, in perform_request response = self._perform_request( File "/home/arches/ENV/lib/python3.10/site-packages/elasticsearch/_sync/client/_base.py", line 316, in _perform_request meta, resp_body = self.transport.perform_request( File "/home/arches/ENV/lib/python3.10/site-packages/elastic_transport/_transport.py", line 342, in perform_request resp = node.perform_request( File "/home/arches/ENV/lib/python3.10/site-packages/elastic_transport/_node/_http_urllib3.py", line 202, in perform_request raise err from None elastic_transport.ConnectionError: Connection error caused by: ConnectionError(Connection error caused by: NewConnectionError(<urllib3.connection.HTTPConnection object at 0x7ff8c7c2f7f0>: Failed to establish a new connection: [Errno 111] Connection refused))

Second try:

how reported here, after "pip install arches==7.6.0a1", the "arches-project create myproject" command fail with error:

Traceback (most recent call last): File "/home/arches/ENV/bin/arches-project", line 158, in main() File "/home/arches/ENV/bin/arches-project", line 151, in main COMMANDSargs.command File "/home/arches/ENV/bin/arches-project", line 67, in command_create_app cmd.handle(options) File "/home/arches/ENV/bin/arches-project", line 34, in handle self.validate_name(project_name, "project") File "/home/arches/ENV/lib/python3.10/site-packages/django/core/management/templates.py", line 290, in validate_name an=self.a_or_an, AttributeError: 'ArchesCommand' object has no attribute 'a_or_an'

Third try:

no version of arches-for-science for docker compose is working. The most common error is the following (after launch of "docker-compose up --build command"):

ERROR [webpack-afs7 5/13] COPY ./arches /web_root/arches > 0.0s

[webpack-afs7 5/13] COPY ./arches /web_root/arches:

failed to solve: failed to compute cache key: "/arches" not found: not found

Is there a particular procedure to follow in order to install Arches for science without problems? I also tried to install it from a clean and working Arches 7.5.1 installation but ran into other errors (which I thought were due to the starting Arches version is not 7.6).

Thank's in advance.

jacobtylerwalls commented 6 months ago

Hi @Gianluke :wave:

The second error is a symptom of an interrupted installation (where some of the files exist already, and so they can't be created again). (The fact that it doesn't fail with a better error is captured as a todo in archesproject/arches#10166.)

To recover from this, try deleting all the files that the first installation attempt created.

The first error is the one that needs to be debugged. It looks like elastic was not running. What was the exact command you ran to setup the db, and from what project did you run it?

I also tried to install it from a clean and working Arches 7.5.1 installation but ran into other errors (which I thought were due to the starting Arches version is not 7.6).

Correct, arches for science for requires an alpha version of arches 7.6, which pip should install for you. https://github.com/archesproject/arches-for-science/blob/ba547c16a053d7b82be64455f5c3b8673b24dff8/pyproject.toml#L29

Gianluke commented 5 months ago

Hi @jacobtylerwalls, regards the Elasticsearch connection error, occurs only by running setup_db after installing arches-for-science: if I install arches the setup_db process ends as expected (this proving that Elasticsearch is always running on the dedicated VM used). It is also up and running based on the checks carried out on the VM (via netstat, curl, etc. commands).

For the second road I followed your suggestion and the installation of arches 7.6.0a1 is gone (even though I had to manually add the module "eslint-webpack-plugin" with command yarn add -D eslint-webpack-plugin following the error:

[webpack-cli] Error: Cannot find module 'eslint-webpack-plugin'

). At this point though, after following what is reported here and during execution of "python manage.py packages -o load_package -a arches_for_science -dev -y" command, the following error occurs:

psycopg2.errors.ForeignKeyViolation: insert or update on table "graphs" violates foreign key constraint "graphs_templateid_92650c21_fk_report_templates_templateid" DETAIL: Key (templateid)=(2b124304-6e42-4c0c-8161-14c010dcef71) is not present in table "report_templates".

Thank you so much for your support.

Regards.

jacobtylerwalls commented 5 months ago

Thanks for the additional details. Sounds like the initial migration in the arches for science application did not run correctly. What is the output of manage.py showmigrations?

jacobtylerwalls commented 5 months ago

The instructions you linked are silent about when to setup the database. If AfS is not added to INSTALLED_APPS yet when setup_db is run, it's possible the migration was never run. Running load_package with the -db flag should do that, but some users might have existing db's they wish to preserve, so I figure we should mention running migrations in the README.