Cannot create project within group
### Summary
Unable to create a project within an existing group. Once the project name, slug and description are completed hitting "enter" generates the following error on the page:
```
The form contains the following error:
PG::NotNullViolation: ERROR: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null, 164, t). : INSERT INTO "project_ci_cd_settings" ("project_id") VALUES (164) RETURNING "id"
```
### Steps to reproduce
1. Navigate to a group where the logged in account is a Maintainer
2. Click on the "New project" button on the group page.
3. Fill out the project name and description fields (the project slug field is populated automatically).
4. Click on the "Create Project" button which results in the error above.
### Example Project
N/A
### What is the current *bug* behavior?
```
The form contains the following error:
PG::NotNullViolation: ERROR: null value in column "id" violates not-null constraint DETAIL: Failing row contains (null, 164, t). : INSERT INTO "project_ci_cd_settings" ("project_id") VALUES (164) RETURNING "id"
```
### What is the expected *correct* behavior?
The project should be created within the group.
### Relevant logs and/or screenshots
(Paste any relevant logs - please use code blocks (```) to format console output,
logs, and code as it's very hard to read otherwise.)
### Output of checks
N/A
#### Results of GitLab environment info
<details>
<summary>Expand for output related to GitLab environment info</summary>
<pre>
$ sudo gitlab-rake gitlab:env:info
System information
System:
Current User: git
Using RVM: no
Ruby Version: 2.5.3p105
Gem Version: 2.7.6
Bundler Version:1.16.6
Rake Version: 12.3.1
Redis Version: 3.2.12
Git Version: 2.18.1
Sidekiq Version:5.2.3
Go Version: go1.11.2 linux/amd64
GitLab information
Version: 11.6.2
Revision: 4d0c547
Directory: /opt/gitlab/embedded/service/gitlab-rails
DB Adapter: postgresql
URL: https://git.library.dartmouth.edu
HTTP Clone URL: https://git.library.dartmouth.edu/some-group/some-project.git
SSH Clone URL: git@git.library.dartmouth.edu:some-group/some-project.git
Using LDAP: no
Using Omniauth: yes
Omniauth Providers: cas3
GitLab Shell
Version: 8.4.3
Repository storage paths:
- default: /data/gitlab-data/git-data/repositories
Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks
Git: /opt/gitlab/embedded/bin/git
</pre>
</details>
#### Results of GitLab application Check
<details>
<summary>Expand for output related to the GitLab application check</summary>
<pre>
$ sudo gitlab-rake gitlab:check SANITIZE=true
Checking GitLab subtasks ...
Checking GitLab Shell ...
GitLab Shell: ... GitLab Shell version >= 8.4.3 ? ... OK (8.4.3)
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK
Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful
Checking GitLab Shell ... Finished
Checking Gitaly ...
Gitaly: ... default ... OK
Checking Gitaly ... Finished
Checking Sidekiq ...
Sidekiq: ... Running? ... yes
Number of Sidekiq processes ... 1
Checking Sidekiq ... Finished
Checking Incoming Email ...
Incoming Email: ... Checking Reply by email ...
IMAP server credentials are correct? ... yes
Init.d configured correctly? ... skipped
MailRoom running? ... skipped
Checking Reply by email ... Finished
Checking Incoming Email ... Finished
Checking LDAP ...
LDAP: ... LDAP is disabled in config/gitlab.yml
Checking LDAP ... Finished
Checking GitLab App ...
Git configured correctly? ... yes
Database config exists? ... yes
All migrations up? ... yes
Database contains orphaned GroupMembers? ... no
GitLab config exists? ... yes
GitLab config up to date? ... yes
Log directory writable? ... yes
Tmp directory writable? ... yes
Uploads directory exists? ... yes
Uploads directory has correct permissions? ... yes
Uploads directory tmp has correct permissions? ... yes
Init script exists? ... skipped (omnibus-gitlab has no init script)
Init script up-to-date? ... skipped (omnibus-gitlab has no init script)
Projects have namespace: ...
3/1 ... yes
3/2 ... yes
3/3 ... yes
12/5 ... yes
3/7 ... yes
3/8 ... yes
3/9 ... yes
3/10 ... yes
3/11 ... yes
3/12 ... yes
3/13 ... yes
2/15 ... yes
3/18 ... yes
23/19 ... yes
3/20 ... yes
22/21 ... yes
3/22 ... yes
3/23 ... yes
22/24 ... yes
3/46 ... yes
3/47 ... yes
3/48 ... yes
22/49 ... yes
22/50 ... yes
3/51 ... yes
22/52 ... yes
3/73 ... yes
3/74 ... yes
3/75 ... yes
3/76 ... yes
3/77 ... yes
3/78 ... yes
3/79 ... yes
3/80 ... yes
3/81 ... yes
3/82 ... yes
3/83 ... yes
3/84 ... yes
3/85 ... yes
3/86 ... yes
3/87 ... yes
3/88 ... yes
3/89 ... yes
3/90 ... yes
3/91 ... yes
3/92 ... yes
22/93 ... yes
3/94 ... yes
3/95 ... yes
3/96 ... yes
32/105 ... yes
32/106 ... yes
32/107 ... yes
32/108 ... yes
3/110 ... yes
3/111 ... yes
3/114 ... yes
3/115 ... yes
3/116 ... yes
12/117 ... yes
23/118 ... yes
23/119 ... yes
23/120 ... yes
23/121 ... yes
23/122 ... yes
23/123 ... yes
23/124 ... yes
23/125 ... yes
23/126 ... yes
23/127 ... yes
23/128 ... yes
23/129 ... yes
23/130 ... yes
23/131 ... yes
23/132 ... yes
23/133 ... yes
23/134 ... yes
23/135 ... yes
23/136 ... yes
23/137 ... yes
23/138 ... yes
23/139 ... yes
3/140 ... yes
23/141 ... yes
34/142 ... yes
35/145 ... yes
35/146 ... yes
35/147 ... yes
35/148 ... yes
35/149 ... yes
35/150 ... yes
35/151 ... yes
35/152 ... yes
23/153 ... yes
3/154 ... yes
3/155 ... yes
3/156 ... yes
3/157 ... yes
3/158 ... yes
3/159 ... yes
3/160 ... yes
3/161 ... yes
3/162 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.5.3)
Git version >= 2.18.0 ? ... yes (2.18.1)
Git user has default SSH configuration? ... yes
Active users: ... 22
Checking GitLab App ... Finished
Checking GitLab subtasks ... Finished
</pre>
</details>
### Possible fixes
No idea.
### Other potentially relevant data
Our gitlab installation was migrated from a source code install to an omnibus installation on a new server over a month ago. We followed the instructions for the migration found on the gitlab documentation without error. The current install has been in daily use without any issues up to discovering this problem. This issue presented itself with version 11.5.x and can be reproduced on our production git instance as well as on our development git server. We have not used any of the CI/CD features in either environment.
Additionally, attempting to push a new project from the commandline produces "API is not accessible". All operations with our existing repos/projects work without error.
```
$ git init
$ git add test.pl
$ git commit -m "initial commit"
# no errors so far...
$ git status
On branch master
nothing to commit, working tree clean
$
$ git push --set-upstream git@gitlab.ourdomain.edu:ourgroup/test-junk.git master
GitLab: API is not accessible
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
```
issue