YouTrack2YouTrack import does not work: You are not logged in.


I am trying to migrate all issues from one YT instance to another.

The import script ( fails at "Get issues from 0 to 20":

Get issues from 0 to 20 
Cant process issues from 0 to 20
Traceback (most recent call last):
 File "/usr/local/lib/python2.7/dist-packages/youtrackutils/", line 422, in youtrack2youtrack
   issues = [i for i in sourceg.getIssues(projectId, query, start, max) if len('-')) > 1]
 File "/usr/local/lib/python2.7/dist-packages/youtrack/", line 781, in getIssues
   'filter': filter}))
 File "/usr/local/lib/python2.7/dist-packages/youtrack/", line 48, in wrapped
   return f(self, *args, **kwargs)
 File "/usr/local/lib/python2.7/dist-packages/youtrack/", line 154, in _req
   raise youtrack.YouTrackException(url, response, content)
YouTrackException: Error for [/issue/byproject/OI?filter=&max=20&after=0]: 401: Unauthorized: You are not logged in.
Traceback (most recent call last):
 File "/usr/local/bin/youtrack2youtrack", line 11, in <module>
 File "/usr/local/lib/python2.7/dist-packages/youtrackutils/", line 147, in main
   project_ids, params=params)
 File "/usr/local/lib/python2.7/dist-packages/youtrackutils/", line 682, in youtrack2youtrack
   raise e
youtrack.YouTrackException: Error for [/issue/byproject/OI?filter=&max=20&after=0]: 401: Unauthorized: You are not logged in.

I tried different source users for the import, but I either

  • get "403: Forbidden: You do not have permissions to Benutzer einsehen. You are logged in as XXXX"
  • or - when I grant the required permission - the above "401: Unauthorized: You are not logged in."
Comment actions Permalink
Official comment


Could you please share a command you use? The error says you're not authorized to perform the import, please check that the credentials in command are correct and you have enough permissions in both YouTrack servers. 

Comment actions Permalink

Hi Anastasia,

I'm using the `youtrack2youtrack` command. Since there are mostly credentials in the command I cannot share the full command line.
But I figured out the problem in the meantime:

You have a bug in your import script. My YouTrack is configured to require a login before you can see any issues. Your import script does not login when it queries for the issues on the source server. That explains the "Unauthorized: You are not logged in" response from the server.

I could get around the bug by hacking `` directly:

415         print("Import issues")
416         last_created_issue_number = 0
418         sourceg = Connection(source_url)


415         print("Import issues")
416         last_created_issue_number = 0
418         sourceg = Connection(source_url, source_login, source_password)

I checked on GitHub to create a pull request, but the source code there is very different.
There is no bug:

I am no python developer, so I cannot tell you, why I have different code in comparision to GitHub. I followed the instructions on  and used the command `pip install youtrack-scripts` to get the import scripts.

Additionally to the instructions I figured out one has to `pip install names` so the import script works at all. It uses this library to generate fake usernames.

Hope that helps anyone running into the same problems :-)

Comment actions Permalink

Thank you for sharing! I will forward it to the responsible developer. 

Just in case, make sure you have the latest version of package installed - run 'pip install -U youtrack-scripts' command.

Comment actions Permalink

Hi @anastasia


I am facing the same issues as described here


Please sign in to leave a comment.