Got 500 ERR when adding a new ssh key
production.log
Started POST "/profile/keys" for 127.0.0.1 at 2015-04-27 18:04:35 +0800
Processing by Profiles::KeysController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "key"=>{"title"=>"BREEZE-P", "key"=>"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrG3W+68MeIT8H8Bdgn5vsbZIKrzk0yGQ7OKh6GDq+RMYaXyf5RSxHSjUsL1FlGrKDQ2i8P5kwNgeWCz/gc9z6XbdaEnqVfKYYQPA/mK8jRIBYNJDRy4Jew9X46MXL3eVlglHzCSgmOCkFfM1v3VS71mlJ3WeRc95axkm7eDThh9g2YkmPfjz9Emb2sX95B5rJXTK1/pvwcgpvjFbZ+lxdqlf1eNgG0Cli4BHDIZ5gkF1WnHnPdOpyrLqhWyNdAoFyNAmDTMxeW1Z9anvCNd59ggckOhIRC6yAVWQYCPkq9aLnwZF0JriiWMUn/77rw3MkbeAguGQCGKjO8gho+kTL breeze@BREEZE-PC\r\n"}}
PG::Error: ERROR: null value in column "public" violates not-null constraint
DETAIL: Failing row contains (25, 2, 2015-04-27 10:04:35.857826+00, 2015-04-27 10:04:35.857826+00, ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrG3W+68MeIT8H8Bdgn5vsbZIK..., BREEZE-P, null, 09:ae:0e:68:99:f2:43:4a:09:d9:97:80:7e:71:f5:2d, null).
: INSERT INTO "keys" ("created_at", "fingerprint", "key", "title", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"
Completed 500 Internal Server Error in 75ms
ActiveRecord::StatementInvalid (PG::Error: ERROR: null value in column "public" violates not-null constraint
DETAIL: Failing row contains (25, 2, 2015-04-27 10:04:35.857826+00, 2015-04-27 10:04:35.857826+00, ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCrG3W+68MeIT8H8Bdgn5vsbZIK..., BREEZE-P, null, 09:ae:0e:68:99:f2:43:4a:09:d9:97:80:7e:71:f5:2d, null).
: INSERT INTO "keys" ("created_at", "fingerprint", "key", "title", "updated_at", "user_id") VALUES ($1, $2, $3, $4, $5, $6) RETURNING "id"):
app/controllers/profiles/keys_controller.rb:20:in `create'
gitlabhq_production=# \d keys
Table "public.keys"
Column | Type | Modifiers
-------------+--------------------------+---------------------------------------------------
id | integer | not null default nextval('keys_id_seq'::regclass)
user_id | integer |
created_at | timestamp with time zone | not null
updated_at | timestamp with time zone | not null
key | text |
title | character varying(510) | default NULL::character varying
type | character varying(510) | default NULL::character varying
fingerprint | character varying(510) | default NULL::character varying
public | boolean | not null
Indexes:
"keys_pkey" PRIMARY KEY, btree (id)
[root@centos64x86 gitlab]# sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.1.2p95
Gem Version: 2.2.2
Bundler Version:1.9.4
Rake Version: 10.4.2
Sidekiq Version:3.3.0
GitLab information
Version: 7.10.0.rc4
Revision: 81112b5
Directory: /home/git/gitlab
DB Adapter: postgresql
URL: http://gitlab.sztq.com
HTTP Clone URL: http://gitlab.sztq.com/some-project.git
SSH Clone URL: git@gitlab.sztq.com:some-project.git
Using LDAP: no
Using Omniauth: no
GitLab Shell
Version: 2.6.2
Repositories: /home/git/repositories/
Hooks: /home/git/gitlab-shell/hooks/
Git: /usr/local/bin/git