Todoist migration gets stuck at Get Started in a loop

I have setup Vikunja config.yml in /etc/vikunja inside of the latest vikunja docker container and on container restart I see that it is found and used.
I have setup correctly in Todoist the Vikunja app with OAuth redirect url ending with /migrate/todoist and App service url with just the frontend url of my local Vikunja.
Upon clicking Get Started, in the bowser console I get the same errors as below - tried 3 different browsers and even in incognito mode - still same behavior:

  • Click on ‘Get Started’ on <frontend_url>/migrate/todoist page
  • get error in browser console and new tab is opened with same url with ‘Get Started’ button
abstractService.ts:291 Uncaught (in promise) TypeError: Cannot create property 'maxRight' on string '<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width,initial-scale=1.0">
	<title>Vikunja</title>
	<meta name="description" content="Vikunja (/vɪˈkuːnjə/) - The to-do app to organize your life.">
	<meta name="theme-color" content="#1973ff"/>

	<link rel="icon" href="/favicon.ico">
	<link rel="apple-touch-icon" href="/images/icons/apple-touch-icon-180x180.png"/>


  <script type="module" crossorigin src="/assets/index-9Lu9q13r.js"></script>
  <link rel="stylesheet" crossorigin href="/assets/index-VlJ-wnF6.css">
  <script type="module">import.meta.url;import("_").catch(()=>1);(async function*(){})().next();if(location.protocol!="file:"){window.__vite_is_modern_browser=true}</script>
  <script type="module">!function(){if(window.__vite_is_modern_browser)return;console.warn("vite: loading legacy chunks, syntax error above and the same error below should be ignored");var e=document.getElementById("vite-legacy-polyfill"),n=document.createElement("script");n.src=e.src,n.onload=function(){System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))},document.body.appendChild(n)}();</script>
<link rel="manifest" href="/manifest.webmanifest"></head>
<body>
<noscript>
	<strong>We're sorry but Vikunja doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<script>
	window.SENTRY_ENABLED = false
	window.SENTRY_DSN = 'https://XXXXXXXXXXXXXXXXX@XXXXXX.ingest.sentry.io/XXXXXX'
	window.ALLOW_ICON_CHANGES = true
	window.CUSTOM_LOGO_URL = ''
</script>
<script>
	//
	// This variable points the frontend to the api.
	// It has to be the full url, including the last /api/v1 part and port.
	// You can change this if your api is not reachable on the same port as the frontend.
	window.API_URL = 'https://<frontend_url_hidden>/api/v1'
</script>
  <script nomodule>!function(){var e=document,t=e.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var n=!1;e.addEventListener("beforeload",(function(e){if(e.target===t)n=!0;else if(!e.target.hasAttribute("nomodule")||!n)return;e.preventDefault()}),!0),t.type="module",t.src=".",e.head.appendChild(t),t.remove()}}();</script>
  <script nomodule crossorigin id="vite-legacy-polyfill" src="/assets/polyfills-legacy-f4-v3K6F.js"></script>
  <script nomodule crossorigin id="vite-legacy-entry" data-src="/assets/index-legacy-GNIYtwqa.js">System.import(document.getElementById('vite-legacy-entry').getAttribute('data-src'))</script>
</body>
</html>
'
    at Proxy.getM (abstractService.ts:291:11)
    at async P (MigrationHandler.vue:163:18)

Please let me know if I am doing anything incorrectly. I even sent manually the Todoist API call with secret and client id with correct scope. I got redirected to the correct OAuth url with appended code and state url param as returned by Todoist API. But even then when I click ‘Get Started’ I still have the same error.

That looks like a bug. Can you open the network tab in the dev tools and check which request is made when you click on the migration start button?

I can’t really tell since it spawns new tab with same page and loads all page assets. Here is what I see in the network tab

Do you have a reverse proxy in place? Is that set up correctly so that it proxies all traffic to the Vikunja container?

Yes, I have Nginx Proxy Manager and any other Vikunja traffic goes directly and correctly to the Vikunja host server. I double checked and the access to this proxy host is public just in case even though it is not exposed to the internet with any port forwarding

The console error I see now happens on loading of the /migrate/todoist, So issue is on the /migrate/todoist page source code and has nothing to do with Get Started button clicking. But also the Get Started clicking simple redirects and loads the same page in new tab.
Do you know what should be the value of Todoist app config page for App Service Url?
I have setup the OAuth redirect url to /migrate/todoist and the App Service url only to

So the /migrate/todoist/auth return the HTML page with warning for Javascript not being enabled which in turn is not expected here Uncaught (in promise) TypeError: Cannot create property ‘maxRight’ on string ' and throws an error.
What could be the reason that javascript is detected as blocked/disabled? My browsers allow it . Is there supposed to be something enabled for this in the container?

in NginX Proxy Manager I have enabled only some basic things like SSL enforce, HTTP/2 support, Block common exploits and is set as publically accessible even though it is not but at least NPM is not blocking it for access from anywhere

This looks like html was returned when an api response was expected. How did you configure your proxy? Did you remove Vikunja’s frontend hosting since it was bundled together in the last release? What have you set as service.publicurl?

Something like https://<your public url>/migrate/todoist should work as a redirect url in Todoist.

I removed vikunja api and proxy containers, reconfigured vikinja/vikinja container to use config.yml file and redeployed the latest docker tag.
Now I have only mariadb for mysql db storage and main all in one vikunja container. All features of the application are working fine - just this migration is somehow malfunctioning.
in the config.yml I have
publicurl: “https://vikunja.iskrenpetkov.net

Keep in mind that this is not actually internet accepting any connections since I have no port forwarding

What is returning html page? which request?
In Todoist OAuth redirect url is https://vikunja.iskrenpetkov.net/migrate/todoist and upon clicking on ‘Get Started’ on migration page I get redirected to it again. What is supposed to happen when I click ‘Get Started’ button ?

@kolaente so debugging this in the browser I see that /migrate/todoist/auth is returning this html page complaining about javascript being blocked. What is causing this complain for javascript? I know that nothing is disabling javascript when I load Vikunja for normal use.

This value of finalUrl is somehow without protocol and domain - just url suffix - any idea why?

ok … :grin: happy to report that after some reconfigure on my side I think I am progressing.
I was using container env vars as well as config.yml. Even though I see in the container start up log that confog.yml is found and used, I suspected that the publicurl var from the env was messing things up.
I remove all env vars, configured static docker network with static container IPs and in config.yml I set the database host to not be localhost but the static container IP.
All these things seems to have helped and I got to the migration initiated confirmation screen. Time will tell if I will get all Todoist items migrated since page states it will take a while.

Maybe @kolaente check if you have time if there is some bug where if config.yml and env vars are passed then they are used together. As far as I remember config.yml values should trump the env vars.

Glad you figured it out! I think this is working as intended, and env variables take precedence over config variables. The UX on this could be better, but usually you shouldn’t set the same two variables in env and a config file.

@kolaente what should be the end user experience after I see the confirmation that Todoist migration will take along time? I have been waiting 24 hours and I don’t see any progress anywhere. I reset the client secret in Todoist app configs for Vikunja and initiated the Todoist migration again. I still don’t see any activity in the container stdout /logs

Directly after migrating, you should see a message like “Vikunja will now pull your data from Todoist, this can take a while, we will send you an email” in the web frontend. You can enable debug logs on the server to see if it’s doing something.

Maybe related to Trello Import Issues - #23 by Elscrux