Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaults for max_execution_time, max_input_time in base.php not configurable #10082

Closed
oc33 opened this issue Jul 2, 2018 · 10 comments
Closed
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug

Comments

@oc33
Copy link

oc33 commented Jul 2, 2018

Steps to reproduce

  1. Run Nextcloud on shared hosting server with strict limits on max_execution_time or max_input_time
  2. Inspect error messages in admin interface

Expected behaviour

No error messages if .user.ini contains values for max_execution_time and max_input_time compatible with server constraints.

Actual behaviour

Settings > Logging shows error messages like

Error | PHP | set_time_limit(): Tried to raise runtime beyond limit (3600/180). at <path>/www/nc/lib/base.php#639 | <timestamp>

at a very high rate.

Server configuration

Operating system: Debian

Web server: unknown

Database: MariaDB

PHP version: 7.2

Nextcloud version: 13.0.4

Updated from an older Nextcloud/ownCloud or fresh install: Updated manually from 12.0.0

Where did you install Nextcloud from: Tarball

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:
Not relevant

Nextcloud configuration:
Not relevant

Are you using external storage, if yes which one: no

Are you using encryption: no

Are you using an external user-backend, if yes which one: no

Client configuration

Irrelevant

Logs

Web server error log

Not available

Nextcloud log (data/nextcloud.log)

See above

Browser log

Not relevant

@oc33
Copy link
Author

oc33 commented Jul 2, 2018

As a work-around, I modified lines 637-640 of lib/base.php to conform with the restrictions set by my hoster:

        //try to set the maximum execution time to 60min                                                                                                                                                                                          
        if (strpos(@ini_get('disable_functions'), 'set_time_limit') === false) {
            @set_time_limit(<hoster_conform_value>);
        }
        @ini_set('max_execution_time', <hoster_conform_value>);
        @ini_set('max_input_time', <hoster_conform_value>);

I tried to set max_execution_time and max_input_time to conforming values in .user.ini, but this did not have any effect, presumably because the code in base.ini contains hard-coded values.

The server works, but pollutes the log file with tremendously many messages.

@nextcloud-bot
Copy link
Member

GitMate.io thinks possibly related issues are #3269 (Default config.php appstore), and #6784 (Php error?).

@night-light
Copy link

Hi, So I've got a similar issue to yours, maybe. I get the following php error, that I get bombarded with like every half second:

set_time_limit(): Cannot set max execution time limit due to system policy at path/httpd.www/nextcloud/lib/base.php#629.

I'm curious about how you found out what your hosting restrictions are and where. Was it in the php interface or did you contact them directly to find out? I'm running on a shared server. What did you change any values to? Was it >3600 or <3600? I looked at the code in the base.php file, but I'm not confident to make any amendments?

@oc33
Copy link
Author

oc33 commented Dec 30, 2018

@night-light My hoster has posted the restrictions in their documentation. The values my hoster allows are much shorter than 3600s. The only changes I made to the code was to enter suitable numbers in the locations marked <hoster_conform_value> in my post above, replacing the default 3600. I need to redo this every time I update my installation, as it overwrites the base.php file.

@night-light
Copy link

@oc33 thank you for your reply! It looked like the set_time_limit is disabled for me and the hoster can't do anything about, not even provide me with the value for some reason as it wasn't possible, they say.

@thrdroom
Copy link

I have the exact same issue but with different needs. I want to set the max_execution_time and max_input_time to 7200 but base.php forces me to "3600". No matter what value i put into php.ini .user.ini or .htaccess - it always gets overwritten by the base.php.

As i want my config to bet update-proof, i don't want to use the workaround by changing the base.php.

This behaviour should be changed, as otherwise the instructions about max_exeecution_time in the documentation are useless Uploading big files > 512MB

@kmark
Copy link

kmark commented Mar 22, 2019

As others have noticed the issues seem to start here: https://github.com/nextcloud/server/blob/v15.0.5/lib/base.php#L623

My workaround was to set all of those as php_admin_flag/values in my PHP-FPM config. That way there is nothing nextcloud can do to change those values.

@stale
Copy link

stale bot commented Jun 8, 2019

This issue has been automatically marked as stale because it has not had recent activity and it seems to be missing some essential informations. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale Ticket or PR with no recent activity label Jun 8, 2019
@skjnldsv skjnldsv added 0. Needs triage Pending check for reproducibility or if it fits our roadmap and removed stale Ticket or PR with no recent activity labels Jun 8, 2019
@skjnldsv
Copy link
Member

skjnldsv commented Sep 9, 2020

As there is no feedback since a while I will close this ticket. If this is still happening please make sure to upgrade to the latest version. After that, feel free to reopen.

@skjnldsv skjnldsv closed this as completed Sep 9, 2020
@oc33
Copy link
Author

oc33 commented Sep 10, 2020

@skjnldsv The values for set_time_limit(), max_execution_time and max_input_time (and also some file-size limits) are still hardcoded in base.php l 617ff. They should be configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Projects
None yet
Development

No branches or pull requests

6 participants