gousiosg / github-mirror

Scripts to mirror Github in a cloudy fashion
BSD 2-Clause "Simplified" License
559 stars 106 forks source link

SQLite3::SQLException: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY #22

Closed ghost closed 8 years ago

ghost commented 8 years ago

Hi during run this command: ght-retrieve-repo user repo I received followed error:

Overriding configuration mirror_history_pages_back=5 with new value 1000 Database empty, running migrations from /var/lib/gems/2.1.0/gems/ghtorrent-0.11.1/lib/ghtorrent/migrations Creating table users Creating table projects Creating table commits Creating table commit_parents Creating table followers Adding organization descriminator field to table users Updating users with default values Creating table organization-members Adding table commit comments Adding table project members Adding table watchers Adding table pull requests Adding table pull request history Adding table pull request commits Adding table pull request comments Adding unique(name, owner) constraint to table projects Create table project_commits Migrating data from commits to project_commits Adding table forks Adding table issues Adding issue history SQLite3::SQLException: AUTOINCREMENT is only allowed on an INTEGER PRIMARY KEY /var/lib/gems/2.1.0/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in `initialize'

Can I resolve this problem?

gousiosg commented 8 years ago

This has been resolved in master. Until a release is pushed to RubyGems, you can do the following

git clone https://github.com/gousiosg/github-mirror.git
cd github-mirror
gem build ghtorrent.gemspec
gem install ghtorrent-0.11.gem

or you can just use the code directly from the checkout like so:

ruby -Ilib bin/ght-retrieve-repo user repo 
edwardmp commented 8 years ago

Encountered same type of issue for both sqlite as mysql today. Would probably be a good idea to push a release..

Master doesn't work either, I had to checkout commit 3474a60a231363405ffa56cac59f3101654c656f to get it to work.

Else it threw:

gem build ghtorrent.gemspec
You have to have changelog gem installed for post install message
WARNING:  See http://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    ["bin/ght-get-more-commits"] are not files

I still get this while it runs though:

SQLite3::SQLException: table users has no column named fake
/Users/edward/.rvm/gems/ruby-2.2.3/gems/sqlite3-1.3.11/lib/sqlite3/database.rb:91:in `initialize'

Or in MYSQL

WARN, 2016-05-11T15:35:49+02:00, ghtorrent -- ghtorrent.rb: Transaction failed (3551 ms)
Mysql2::Error: Unknown column 'fake' in 'field list'
/Users/edward/.rvm/gems/ruby-2.2.3/gems/mysql2-0.4.4/lib/mysql2/client.rb:107:in `_query'
gousiosg commented 8 years ago

Thanks for reporting this @edwardmp, can you please check again (with master)?

edwardmp commented 8 years ago

@gousiosg yep works, thanks