google-code-issues-migrator icon indicating copy to clipboard operation
google-code-issues-migrator copied to clipboard

Crash after migrating a few issues

Open eXpl0it3r opened this issue 11 years ago • 6 comments

So I've been trying to move all the issues from the official Box2D Google Code project to GitHub, but for some reason it always fails with the Bad credentials exception. Since it works for x numbers of issues and only then errors out, it's definitely not a problem of my credentials and my guess would rather be, that the GitHub API blocks after a certain amount of calls, but I've no experience in that area.

Here's the output:

C:\Dev\Python27\Scripts>python migrateissues.py box2d eXpl0it3r Box2D
Github password:
Retrieving existing Github issues...
Retrieved 376 issues; identifying ones already migrated...
Adding issue 1, adding comments..
[...]
Adding issue 75
Adding issue 76, adding comments..
Adding issue 77, adding comments......................
Adding issue 78Usage: migrateissues.py [options] <google project name> <github username> <github project>

Migrate all issues from a Google Code project to a Github project.

Options:
  -h, --help            show this help message and exit
  -a, --assign-owner    Assign owned issues to the Github user
  -b BASE_ID, --base-id=BASE_ID
                        Number of issues in Github before migration
  -d, --dry-run         Don't modify anything on Github
  -p, --omit-priority   Don't migrate priority labels
  -s, --synchronize-ids
                        Ensure that migrated issues keep the same ID
Traceback (most recent call last):
  File "migrateissues.py", line 360, in <module>
    process_gcode_issues(existing_issues)
  File "migrateissues.py", line 279, in process_gcode_issues
    add_comments_to_issue(github_issue, gid)
  File "migrateissues.py", line 191, in add_comments_to_issue
    existing_comments = [ comment.body for comment in github_issue.get_comments() ]
  File "C:\Dev\Python27\lib\site-packages\github\PaginatedList.py", line 35, in __iter__
    newElements = self.__grow()
  File "C:\Dev\Python27\lib\site-packages\github\PaginatedList.py", line 47, in __grow
    newElements = self._fetchNextPage()
  File "C:\Dev\Python27\lib\site-packages\github\PaginatedList.py", line 104, in _fetchNextPage
    headers, data = self.__requester.requestJsonAndCheck("GET", self.__nextUrl, self.__nextParams, None)
  File "C:\Dev\Python27\lib\site-packages\github\Requester.py", line 84, in requestJsonAndCheck
    return self.__check(*self.requestJson(verb, url, parameters, input))
  File "C:\Dev\Python27\lib\site-packages\github\Requester.py", line 92, in __check
    raise GithubException.GithubException(status, output)
github.GithubException.GithubException: 401 {u'message': u'Bad credentials'}

Restarting it again mostly leads to duplication of issues and since it never really finishes (never reached issue 302), I basically can't migrate everything.

Does anyone know if there's some API limitation that errors out with Bad credentials or see where the error might originate from otherwise?

Besides that, it would be great if one could specify an issue number, from where the script should start from copying, since it takes quite a bit to skip over one issue.

eXpl0it3r avatar Mar 07 '13 16:03 eXpl0it3r

It looks like that this problem occurs only on machines with a fast internet connection. No Problems at home (down 16MB, up 640KB), same problem when running this script from a 100MB/100MB connection.

Edit: No, it has nothing to do with the connection.

danielniccoli avatar Mar 19 '13 09:03 danielniccoli

Oh, and this repository is dead. Check the forks under the Network tab for more recent versions.

danielniccoli avatar Mar 19 '13 09:03 danielniccoli

Ah hadn't thought of looking at the forks, thanks!

Too bad people abandon their projects like this. :-\

eXpl0it3r avatar Mar 19 '13 10:03 eXpl0it3r

I don't like it either. I asked Arthur to at least write a quick note into the README. It was obviously asked too much. He also did not pull my quick fixes. Check the forks, find one you like and contribute to that, if you feel like it.

danielniccoli avatar Mar 19 '13 14:03 danielniccoli

@eXpl0it3r you also could check my fork. No guarantee, but I think my fork does not produce duplicates. At least, not that I remember :)

danielniccoli avatar Mar 19 '13 16:03 danielniccoli

I already starred your fork, so I can easily find it again, but I don't have the time to working with it, so I will certainly check it out later. ;) Thanks for everything.

eXpl0it3r avatar Mar 19 '13 17:03 eXpl0it3r