Error occurred when importing from Trello

Hello.
I installed taiga from source code into a production environment.
I created a test project on taiga after installation and tried adding a user, and it seems to be working fine.
However, when I import from Trello, “The Taiga is importing your project” is displayed after a series of operations, but a new project is not created by import.

I did the import following the guide on this page.

The API key and private key appear to be correct.
This is because when I tried setting these two keys in reverse, I was unable to proceed to the access authorization screen for Trello.

When I looked for the error message to find out the cause, I found the following using journalctl.

sudo journalctl -u taiga-async.service -xe

May 01 16:56:05 v133-18-228-218 celery[629123]: [2024-05-01 07:56:05,873: ERROR/MainProcess] Received unregistered task of type 'taiga.importers.trello.tasks.import_project'.
May 01 16:56:05 v133-18-228-218 celery[629123]: The message has been ignored and discarded.
May 01 16:56:05 v133-18-228-218 celery[629123]: Did you remember to import the module containing this task?
May 01 16:56:05 v133-18-228-218 celery[629123]: Or maybe you're using relative imports?
May 01 16:56:05 v133-18-228-218 celery[629123]: Please see
May 01 16:56:05 v133-18-228-218 celery[629123]: http://docs.celeryq.org/en/latest/internals/protocol.html
May 01 16:56:05 v133-18-228-218 celery[629123]: for more information.
May 01 16:56:05 v133-18-228-218 celery[629123]: The full contents of the message body was:
May 01 16:56:05 v133-18-228-218 celery[629123]: b'\x80\x04\x95@\x01\x00\x00\x00\x00\x00\x00(K\x07\x8cLATTAa9052a46287eb2b03ccc6463b7030dfa83302e20cb36d41741eaadff3c4c593XXXXXXXXX\x94\x8c\x1864eeb4f0513c157162a7484a\x94}\x94(\x8c\x04name\x94\x8c\x12\xe4\xbb\x95\xe4\xba\x8b\xe7\x94\xa8\xe3\x81\x93\xe3\x81\x98\xe3\x82\x93\x94\x8c\x0bdescription\x94\x8c\x1cTrello import 20240511 16:55\x94\x8c\x08template\x94\x8c\x06kanban\x94\x8c\x0eusers_bindings\x94}\x94\x8c\x17keep_exter>
May 01 16:56:05 v133-18-228-218 celery[629123]: Thw full contents of the message headers:
May 01 16:56:05 v133-18-228-218 celery[629123]: {'lang': 'py', 'task': 'taiga.importers.trello.tasks.import_project', 'id': '1f3e8d3a-09ee-46b4-a768-e53e846e4c50', 'shadow': None, 'eta': None, 'expires': None, 'group': None, 'group_index': None, 'retries': 0, 'timelimit': [None, None], 'root_id': '1f3e8d3a-09ee-46b4-a768-e53e846e4c50', 'parent_id': None, 'argsrepr': "(7, 'ATTAa9052a46287eb2b03ccc6463b7030dfa83302e20cb36d41741eaadff3c4c593XXXXXXXXX', '64eeb4f0513c157162a>
May 01 16:56:05 v133-18-228-218 celery[629123]: The delivery info for this task is:
May 01 16:56:05 v133-18-228-218 celery[629123]: {'consumer_tag': 'None4', 'delivery_tag': 137, 'redelivered': False, 'exchange': 'tasks', 'routing_key': 'task.default'}
May 01 16:56:05 v133-18-228-218 celery[629123]: Traceback (most recent call last):
May 01 16:56:05 v133-18-228-218 celery[629123]:   File "/home/taiga/taiga-back/.venv/lib/python3.10/site-packages/celery/worker/consumer/consumer.py", line 591, in on_task_received
May 01 16:56:05 v133-18-228-218 celery[629123]:     strategy = strategies[type_]
May 01 16:56:05 v133-18-228-218 celery[629123]: KeyError: 'taiga.importers.trello.tasks.import_project'

I have enabled the Trello importer in “~/taiga-back/settings/config.py” and “~/taiga-front-dist/dist/conf.json”.
Are there any other settings I should change?

In addition, “~/taiga-back/settings/common.py” also has settings for his Trello importer, but I think this overrides the settings in “config.py”, and the “active:”:False" It’s still there.

Thank you for your advice.

Hi there, I also have installed taiga in production environment. There should a option of allowed origins where you will have to put your taiga hosted site’s url in trello api or powerup management. Did u configure that?

1 Like

Hi there,

It is the other way around, config.py overwrites common.py, so it’s okay to just change stuff in config.py.

From the logs, it seems that maybe your celery and rabbitmq configuration may not be working correctly? Could you share your related config?

It should look something like this:

#########################################
## TAIGA ASYNC
#########################################

CELERY_ENABLED = True
CELERY_WORKER_MAX_TASKS_PER_CHILD = 100

from kombu import Queue  # noqa

CELERY_BROKER_URL = "..."
CELERY_TIMEZONE = "UTC"

CELERY_TASK_ROUTES = {
   "taiga.export_import.tasks.dump_project": {"queue": "exporter"},
   "taiga.export_import.tasks.load_project_dump": {"queue": "importer"},
   "taiga.export_import.tasks.delete_project_dump": {"queue": "exporter"},
}

Best regards!

1 Like

thank you for your reply.

I configured the Taiga hosted URL in the Trello API.
However, if you ask me if that is correct, I am not confident.
As a result of my setup, “Trello Power up” looks like this screenshot.
Is this the correct result?

By the way, when I saved this screenshot, I noticed that there was an item called “Capabilities”.
All the “Capabilities” switches were turned off.
I still don’t really understand what each switch means, but it looks like an auxiliary setting.
However, turning everything off seems to be a problem.

thank you.

thank you for your reply.
I was relieved that all I had to do was change config.py.

The configuration and settings of “rabbitmq” are really difficult for me.
My host’s taiga-back/settings/config.py is shown below.

#########################################
## TAIGA ASYNC
#########################################
CELERY_ENABLED = os.getenv('CELERY_ENABLED', 'True') == 'True'

from kombu import Queue  # noqa

CELERY_BROKER_URL = "amqp://rabbitmquser:rabbitmqpassword@localhost:5672/taiga"
CELERY_RESULT_BACKEND = None # for a general installation, we don't need to store the results
CELERY_ACCEPT_CONTENT = ['pickle', ]  # Values are 'pickle', 'json', 'msgpack' and 'yaml'
CELERY_TASK_SERIALIZER = "pickle"
CELERY_RESULT_SERIALIZER = "pickle"
CELERY_TIMEZONE = 'Europe/Madrid'
CELERY_TASK_DEFAULT_QUEUE = 'tasks'
CELERY_QUEUES = (
    Queue('tasks', routing_key='task.#'),
    Queue('transient', routing_key='transient.#', delivery_mode=1)
)
CELERY_TASK_DEFAULT_EXCHANGE = 'tasks'
CELERY_TASK_DEFAULT_EXCHANGE_TYPE = 'topic'
CELERY_TASK_DEFAULT_ROUTING_KEY = 'task.default'

There are several differences between the configuration you showed and my configuration.
The big difference is that “CELERY_TASK_ROUTES” does not exist in my config.py.
I would be very happy if you could point out my mistakes.

If there is a shortcut to overwriting my config.py with the settings you showed, I will try it.

thank you.

“Import from Trello” worked.
By setting “CELERY_ENABLED” in config.py to True, the error no longer occurs.

#########################################
## TAIGA ASYNC
#########################################
# CELERY_ENABLED = os.getenv('CELERY_ENABLED', 'True') == 'True'
CELERY_ENABLED = True

thank you very much.

2 Likes