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

Failed to set up a developmenent environment #80

Open
troopa81 opened this issue Feb 19, 2025 · 5 comments
Open

Failed to set up a developmenent environment #80

troopa81 opened this issue Feb 19, 2025 · 5 comments
Assignees
Labels

Comments

@troopa81
Copy link

I would like to implement the last bit of QEP qgis/QGIS-Enhancement-Proposals#287, the "Trigger linters on plugins.qgis.org" part.

I followed the given instructions to reproduce a development environment and stumble on different issues, some I managed to solve, some I didn't:

  • We need to copy .env.template in .envto have the Makefile commands work. Maybe we should add it to the INSTALL.md instructions
  • rabbitmq-3.7 was not working, I had to replace it with rabbitmq:3.13.7-alpine to have it working
  • finally I got the following errors
2025-02-19 13:50:00.065486+00:00 [info] <0.1115.0> connection <0.1115.0> (172.18.0.10:52860 -> 172.18.0.4:5672): user 'guest' authenticated and granted access to vhost '/'
qgis-plugins-worker   | [2025-02-19 07:50:00,066: ERROR/ForkPoolWorker-16] Task plugins.tasks.generate_plugins_xml.generate_plugins_xml[a9bdf704-d065-4d02-8e46-3db54e032a3e] raised unexpected: ProgrammingError('relation "preferences_sitepreference" does not exist\nLINE 1: SELECT 1 AS "a" FROM "preferences_sitepreference" INNER JOIN...\n                             ^\n')
qgis-plugins-worker   | Traceback (most recent call last):
qgis-plugins-worker   |   File "/usr/local/lib/python3.12/site-packages/django/db/backends/utils.py", line 89, in _execute
qgis-plugins-worker   |     return self.cursor.execute(sql, params)
qgis-plugins-worker   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
qgis-plugins-worker   | psycopg2.errors.UndefinedTable: relation "preferences_sitepreference" does not exist
qgis-plugins-worker   | LINE 1: SELECT 1 AS "a" FROM "preferences_sitepreference" INNER JOIN...
qgis-plugins-worker   |                              ^
qgis-plugins-worker   | 

and

qgis-plugins-db       | 2025-02-19 13:45:21.564 UTC [303] docker@metabase FATAL:  database "metabase" does not exist

It looks like the base is incomplete or not what the application expect. I populated using the command provided in INSTALL.md

make dbseed

Maybe it's best to restore a db dump, but I can't see none in the repository.

@Xpirix
Copy link
Collaborator

Xpirix commented Feb 20, 2025

Thanks for reporting this @troopa81 . The development environment instructions need some updates indeed.

rabbitmq-3.7 was not working, I had to replace it with rabbitmq:3.13.7-alpine to have it working

However, it's the version used both in staging and production. I will check it with a clean setup.

Finally I got the following errors

qgis-plugins-worker   | [2025-02-19 07:50:00,066: ERROR/ForkPoolWorker-16] Task plugins.tasks.generate_plugins_xml.generate_plugins_xml[a9bdf704-d065-4d02-8e46-3db54e032a3e] raised unexpected: ProgrammingError('relation "preferences_sitepreference" does not exist\nLINE 1: SELECT 1 AS "a" FROM "preferences_sitepreference" INNER JOIN...\n                             ^\n')
qgis-plugins-worker   | Traceback (most recent call last):
qgis-plugins-worker   |   File "/usr/local/lib/python3.12/site-packages/django/db/backends/utils.py", line 89, in _execute
qgis-plugins-worker   |     return self.cursor.execute(sql, params)
qgis-plugins-worker   |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
qgis-plugins-worker   | psycopg2.errors.UndefinedTable: relation "preferences_sitepreference" does not exist
qgis-plugins-worker   | LINE 1: SELECT 1 AS "a" FROM "preferences_sitepreference" INNER JOIN...
qgis-plugins-worker   |                              ^
qgis-plugins-worker   | 

It seems like a migration error. Did you try to run make migrate?

qgis-plugins-db | 2025-02-19 13:45:21.564 UTC [303] docker@metabase FATAL: database "metabase" does not exist
It looks like the base is incomplete or not what the application expect. I populated using the command provided in INSTALL.md
make dbseed
Maybe it's best to restore a db dump, but I can't see none in the repository.

I think the fixtures used in make dbseed are deprecated and don't reflect the current version of the code. I always restore a db dump from the db backups and I think we can generate an empty one or with some mock data.

I will add this issue to my work planning and come up with updated instructions for a clean development setup.

@troopa81
Copy link
Author

However, it's the version used both in staging and production. I will check it with a clean setup.

Yes, this is weird indeed. Maybe staging and production machine have an old cached image and the new one is not working.

But if you run this command

docker run --rm --hostname my-rabbit --name some-rabbit -e RABBITMQ_DEFAULT_USER=user -e RABBITMQ_DEFAULT_PASS=password rabbitmq:3.7-alpine

nothing happen. But if you replace with version 3.13.7-alpine, It works

It seems like a migration error. Did you try to run make migrate?

Yes

I think the fixtures used in make dbseed are deprecated and don't reflect the current version of the code. I always restore a db dump from the db backups and I think we can generate an empty one or with some mock data.

Is this possible to access to this backups?

I will add this issue to my work planning and come up with updated instructions for a clean development setup.

Thank you 🙏

@Xpirix
Copy link
Collaborator

Xpirix commented Feb 20, 2025

Is this possible to access to this backups?

I will push it along with the updated instructions for the development setup. However, it will just contain some mock data ( doesn't include the real data for security and size reasons) to easily start the development environment.

@troopa81
Copy link
Author

I will push it along with the updated instructions for the development setup. However, it will just contain some mock data ( doesn't include the real data for security and size reasons) to easily start the development environment.

Great, thanks 🙏

@Xpirix
Copy link
Collaborator

Xpirix commented Feb 20, 2025

My pleasure 😊.

@Xpirix Xpirix moved this from Todo to Next Sprint in QGIS Websites Maitenance Feb 24, 2025
@Xpirix Xpirix moved this from Next Sprint to Todo in QGIS Websites Maitenance Feb 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Development

No branches or pull requests

2 participants