FS#62619 - [gitlab] Uploading a JPG to an issue/merge request causes an HTTP 500 error

Attached to Project: Community Packages
Opened by Steven Cook (princeconcord) - Monday, 13 May 2019, 03:35 GMT
Last edited by Sven-Hendrik Haase (Svenstaro) - Friday, 24 May 2019, 03:44 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sven-Hendrik Haase (Svenstaro)
Architecture x86_64
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:
When attaching a JPG image to an issue or a merge request, Gitlab throws an HTTP 500 (internal server error). Uploading a GIF or PNG doesn't throw this error.

The cause of this is that Gitlab relies on calling a Perl binary called `exiftool`, which is a binary from the package `extra/perl-image-exiftool`. This package is not currently set as a dependency for Gitlab.

Please note that this issue also happens in Gitlab EE (enterprise edition) as well as CE (community edition).

This issue can be fixed by doing the following:

```
# pacman -S perl-image-exiftool
# ln -s /usr/bin/vendor_perl/exiftool /usr/bin/exiftool
```

I.e. putting `exiftool` in either a global path or the gitlab user's path will fix the issue. A Gitlab restart is not necessary.

Additional info:
* Occurs even in the latest version: `11.10.4-1`
* No Gitlab configuration changes required by end users, apart from the fix above
* I've also reported this issue upstream: https://gitlab.com/gitlab-org/gitlab-ce/issues/60853

Steps to reproduce:
- Create an issue or merge request
- In the message box, click the **Attach a file** link, then choose a JPG
- Observe the **Internal server error** message to the left of the link you just clicked.
- Check the Gitlab workhorse logs to view the exact error message that the exiftool binary wasn't found.
This task depends upon

Closed by  Sven-Hendrik Haase (Svenstaro)
Friday, 24 May 2019, 03:44 GMT
Reason for closing:  Fixed
Comment by Steven Cook (princeconcord) - Tuesday, 14 May 2019, 02:59 GMT
So after inspecting the other gitlab packages and seeing the output from `gitlab-workhorse`, I'm thinking that the dependency and path inclusion should belong in that package instead.

PKGBUILD:
- `dependencies=(... 'perl-image-exiftool')`

Systemd unit file:
- `Environment="PATH=/usr/bin/vendor_perl:$PATH"`
Comment by Sven-Hendrik Haase (Svenstaro) - Friday, 17 May 2019, 02:10 GMT
Thanks for the suggested fix. I applied it. Please check.

Loading...