[BUG] unable to import Trello projects from Taiga6.
Fjaler opened this issue · 1 comments
Describe the bug
I am unable to import Trello projects from Taiga6.
It probably relates to taiga-back only.
How can we reproduce the behavior
What I have done is to
Install Taiga from the "Install Taiga in Production" page
https://docs.taiga.io/setup-production.html
on a fresh Ubuntu 20.04 LTS Virtual Machine running in Windows 10 HyperV.
I can bring Taiga up and down, and everything seems to be working like
a charm (after fixing docker-compose.yml/taiga-events with restart:
always ... my events container is always struggling during startup).
I have added the Trello importer to docker-compose.yml and the Icon
shows up under "Import Project".
I have received an API key from the Trello board and a secret Trello
key from the admin on the trello project. They are added to taiga-back
as explained in "Install Taiga in Production".
TRELLO_IMPORTER_API_KEY: "12abe54553298739cdfe394497712ef3"
TRELLO_IMPORTER_SECRET_KEY: "32b2a7cdefd1d5ffacdcea6473e253a8417b365872990aecddee4222feea65f2"
ENABLE_TRELLO_IMPORTER: "true" is set in taiga-back and taiga-front
(keys changed for publication)
I can confirm my (key,token) pair against Trello using this command:
curl 'https://api.trello.com/1/members/me/boards?key={yourKey}&token={yourToken}'
[
Used these guides :
https://developer.atlassian.com/cloud/trello/guides/rest-api/api-introduction/
https://developer.atlassian.com/cloud/trello/guides/rest-api/authorization/
]
and confirmed that changing the token gives invalid token.
(I consider this a confirmation of the Trello token signature.)
When I press the Trello importer icon I get the error below:
Error message from Crome Console
elements.js:1 GET http://xxx.xxx.xxx.xxx:9000/api/v1/importers/trello/auth_url 500 (Internal Server Error)
(I see the same thing in Firefox, and no other errors are present in browser)
I am not using HTTPS for my Taiga installation yet (On LAN).
I have tried with several different (key, token) pairs, that are all confirmed with curl
I have tried combinations of
TRELLO_IMPORTER_API_KEY: "12abe54553298739cdfe394497712ef3"
TRELLO_IMPORTER_API_KEY: 12abe54553298739cdfe394497712ef3
(ie: with and without quotes)
Workarounds
I have no workaround. We are unable to import Trello projects.
Screenshots
Not applicable
Taiga environment
Taiga6
Log of incident from docker-compose:
taiga-back_1 | Content-Type: text/plain; charset="utf-8"
taiga-back_1 | MIME-Version: 1.0
taiga-back_1 | Content-Transfer-Encoding: 7bit
taiga-back_1 | Subject: [Django] ERROR (EXTERNAL IP): Internal Server Error:
taiga-back_1 | /api/v1/importers/trello/auth_url
taiga-back_1 | From: root@localhost
taiga-back_1 | To: exa...@example.com
taiga-back_1 | Date: Wed, 16 Feb 2022 12:20:34 -0000
taiga-back_1 | Message-ID: 164501403415.45.9413826841150724929@191f635416e9
taiga-back_1 |
taiga-back_1 | Internal Server Error: /api/v1/importers/trello/auth_url
taiga-back_1 |
taiga-back_1 | Exception Value: Token request failed with code 400, response was 'Invalid Signature'.
taiga-back_1 | Request information:
taiga-back_1 | USER: admin
taiga-back_1 | -------------------------------------------------------------------------------
taiga-back_1 | ERROR:2022-02-16 12:20:34,143: Internal Server Error: /api/v1/importers/trello/auth_url
taiga-back_1 | Traceback (most recent call last):
taiga-back_1 | File "/opt/venv/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner
taiga-back_1 | response = get_response(request)
taiga-back_1 | File "/opt/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response
taiga-back_1 | response = self.process_exception_by_middleware(e, request)
taiga-back_1 | File "/opt/venv/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response
taiga-back_1 | response = wrapped_callback(request, *callback_args, **callback_kwargs)
taiga-back_1 | File "/taiga-back/taiga/base/api/viewsets.py", line 95, in view
taiga-back_1 | return self.dispatch(request, *args, **kwargs)
taiga-back_1 | File "/opt/venv/lib/python3.7/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
taiga-back_1 | return view_func(*args, **kwargs)
taiga-back_1 | File "/taiga-back/taiga/base/api/views.py", line 449, in dispatch
taiga-back_1 | response = self.handle_exception(exc)
taiga-back_1 | File "/taiga-back/taiga/base/api/views.py", line 447, in dispatch
taiga-back_1 | response = handler(request, *args, **kwargs)
taiga-back_1 | File "/taiga-back/taiga/importers/trello/api.py", line 105, in auth_url
taiga-back_1 | (oauth_token, oauth_secret, url) = TrelloImporter.get_auth_url()
taiga-back_1 | File "/taiga-back/taiga/importers/trello/importer.py", line 512, in get_auth_url
taiga-back_1 | response = session.fetch_request_token(request_token_url)
taiga-back_1 | File "/opt/venv/lib/python3.7/site-packages/requests_oauthlib/oauth1_session.py", line 287, in fetch_request_token
taiga-back_1 | token = self._fetch_token(url, **request_kwargs)
taiga-back_1 | File "/opt/venv/lib/python3.7/site-packages/requests_oauthlib/oauth1_session.py", line 369, in _fetch_token
taiga-back_1 | raise TokenRequestDenied(error % (r.status_code, r.text), r)
taiga-back_1 | requests_oauthlib.oauth1_session.TokenRequestDenied: Token request failed with code 400, response was 'Invalid Signature'.
taiga-gateway_1 | xxx.xxx.xxx.yyy - - [16/Feb/2022:12:20:34 +0000] "GET /api/v1/importers/trello/auth_url HTTP/1.1" 500 27 "http://xxx.xxx.xxx.zzz:9000/project/new/import" "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:97.0) Gecko/20100101 Firefox/97.0" "-"
Desktop (please complete the following information):
-
OS:
I have tested this on Ubuntu 20.04 LTS running in two different Virtual Machines.
Windows 10, Hyper V
and
ubuntu 16.04 lts -
Browser / Version:
From windows : Firefox 97 and Crome 98.0.4758.102 gives same results
(Browser on Ubuntu VM gives same results)
Additional context
This issue is posted on : taigaio@googlegroups.com / 16feb
with subject : [Trello importer problem : 'Invalid Signature']
Hi @Fjaler I follow this steps to enable the Trello importer.
- Go to https://trello.com/app-key to obtain an API_KEY and a SECRET. Remember to add your taiga URL, in my case
http://localhost:9000
(the Taiga frontend host)
- Modify
docker-compose.yml
to enable the trello importer.
diff --git a/docker-compose.yml b/docker-compose.yml
index 69b1c2b..d9a0e8f 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -27,6 +27,10 @@ x-environment:
RABBITMQ_PASS: taiga
# Telemetry settings
ENABLE_TELEMETRY: "True"
+ # TRELLO IMPORTEER
+ ENABLE_TRELLO_IMPORTER: "True"
+ TRELLO_IMPORTER_API_KEY: "c9************************18"
+ TRELLO_IMPORTER_SECRET_KEY: "0b******************************************************c5"
x-volumes:
&default-back-volumes
@@ -88,6 +92,7 @@ services:
TAIGA_URL: "http://localhost:9000"
TAIGA_WEBSOCKETS_URL: "ws://localhost:9000"
TAIGA_SUBPATH: "" # "" or "/subpath"
+ ENABLE_TRELLO_IMPORTER: "true"
networks:
- taiga
# volumes:
- That's all. Start your taiga instance with
docker-compose up -d
Then I can import projects:
And in a few seccons I have my project imported in Taiga.
Please let me know if this miniguide is useful and feel free to reopen this issue if you still can't make it work.
Best regards