Artifacts for pages are too large, when max size set to 0
In my pipeline pages:deploy fails with: artifacts for pages are too large: 62157779 (size in bytes)
If i set the "Maximum size of pages (MB)" in the Admin panel to 0, which should be "unlimited".
The error does NOT occur when i set it to 8196 (pages:deploy works).
deploying small pages (some HTML files) work with setting the value to 0..
If i look into the code responsible for the errormessage in app/services/projects/update_pages_service.rb ( https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/services/projects/update_pages_service.rb#L92 )
the error is triggered once public_entry.total_size
is bigger than max_size
max_size is defined as
def max_size current_application_settings.max_pages_size.megabytes || MAX_SIZE end
so if current_application_settings.max_pages_size.megabytes == 0
MAX_SIZE
is used if i understand Ruby correctly..
MAX_SIZE is defined as
MAX_SIZE = 1.terabyte
which should be number of bytes in 1 terrabyte (magnitudes higher than my 62157779 bytes) according to http://api.rubyonrails.org/classes/Numeric.html#method-i-terabytes
I don´t know maybe this is due to string / int comparision? and 1 terrabytes starts with a 1 in bytes and 8196 MBytes (8594128896) starts with a 8 which is greater than 6?
What bugs me is: It works with pages in the KB range when set to 0 but doesnt´t work for large ones.. but it works when set to 8196MB for large ones :(
Regarding Error message:
- The errormessage should display the size in a human readable format and not in bytes! Filesize gem could be used: Filesize.from("12502343 B").pretty ( https://github.com/dominikh/filesize )
- It would be nice to output the current set limit as well (would help with debugging as well ;))
i found a very old other bug report with a similar problem #3812 (closed) there is #2823 (closed) in Gitlab EE aswell which might be related.
Versions: GitLab 9.3.6 GitLab Shell 5.1.1 GitLab Workhorse v2.1.1 GitLab API v4 Git 2.13.0 Ruby 2.3.3p222 Rails 4.2.8 postgresql 9.6.3