Wiki can not Attach a file: POST /api/v4/projects/XX/wikis/attachments 403 (Forbidden)

Summary

After update Gitlab, Wiki can not Attach a file. When i select a file, 403 (Forbidden) error show.

Steps to reproduce

Enter Wiki pages, edit or new page. Press Attach a file, select a file, press ok.

Example Project

http://27.17.7.86:96/open/test/wikis/home/edit

  • Username: bug
  • Password: 12345678

What is the current bug behavior?

Wiki can not Attach a file

What is the expected correct behavior?

attach a file ok

Relevant logs and/or screenshots

The right bottom of editor show error: 403 Forbidden Try again or attach a new file.

Chrome Console show:

document-register-element.node.js:1296 [Deprecation] document.registerElement is deprecated and will be removed in M73, around March 2019. Please use window.customElements.define instead. See https://www.chromestatus.com/features/4642138092470272 for more details.
qe @ document-register-element.node.js:1296
15:05:36.364 dropzone.js:1371 XHR finished loading: OPTIONS "http://np.lilu.red:96/api/v4/projects/55/wikis/attachments".
s.submitRequest @ dropzone.js:1371
s.uploadFiles @ dropzone.js:1367
s.processFiles @ dropzone.js:1161
s.processFile @ dropzone.js:1147
s.processQueue @ dropzone.js:1140
(anonymous) @ dropzone.js:1004
setTimeout (async)
s.enqueueFile @ dropzone.js:1002
(anonymous) @ dropzone.js:981
accept @ dropzone.js:153
s.accept @ dropzone.js:959
s.addFile @ dropzone.js:973
(anonymous) @ dropzone.js:572
15:05:36.391 np.lilu.red:96/api/v4/projects/55/wikis/attachments:1 POST http://np.lilu.red:96/api/v4/projects/55/wikis/attachments 403 (Forbidden)
15:05:36.413 XHR failed loading: POST "http://np.lilu.red:96/api/v4/projects/55/wikis/attachments".

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Ubuntu 16.04 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: unknown

GitLab information Version: 11.6.1 Revision: 598c5a7 Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: postgresql URL: http://np.lilu.red:96 HTTP Clone URL: http://np.lilu.red:96/some-group/some-project.git SSH Clone URL: git@np.lilu.red:some-group/some-project.git Using LDAP: no Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 8.4.3 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories Hooks: /opt/gitlab/embedded/service/gitlab-shell/hooks Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

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: ... Reply by email is disabled in config/gitlab.yml

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: ... 2/1 ... yes 14/5 ... yes 2/9 ... yes 14/10 ... yes 2/11 ... yes 2/14 ... yes 2/16 ... yes 2/18 ... yes 2/20 ... yes 37/22 ... yes 37/24 ... yes 2/25 ... yes 37/26 ... yes 37/28 ... yes 2/29 ... yes 37/30 ... yes 37/31 ... yes 37/32 ... yes 2/33 ... yes 38/34 ... yes 37/35 ... yes 37/36 ... yes 37/37 ... yes 2/38 ... yes 2/39 ... yes 2/40 ... yes 2/43 ... yes 2/50 ... yes 2/51 ... yes 37/52 ... yes 2/53 ... yes 2/54 ... yes 38/55 ... 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: ... 19

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Edited by LiXiaoming