• Resolved max_Q

    (@max_q)


    In attempting to do an initial commit of the entire WordPress install of an existing site, I ran up against what appears to be a hard limit on the number of arguments allowed on this site’s host (Dreamhost).

    The error title was “418 Unused” and the error log contained this:
    ModSecurity: Access denied with code 418 (phase 2). Operator GT matched 3000 at ARGS. The log then referenced a mod_sec .conf file.

    The existing site had +-4700 files to commit, and I’m guessing from the error message that Dreamhost has a limit of 3000 arguments.

    I tried committing the files in chunks by unstaging everything but one top-level directory, like wp-admin. Subsequent to the commit, though, I couldn’t get Revisr to see all the remaining files as untracked. It was showing 0 untracked files.

    The method that worked for me was to add everything to .gitignore and then unignore one directory at a time. Over a number of commits, I manged to get the whole site committed.

    This seemes like something that could happen on other hosts, and I don’t know if you can test for this situation, but it is an impediment to committing the entire WordPress install of an existing site in one go.

    Cheers

    https://wordpress.org/plugins/revisr/

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Expanded Fronts

    (@expandedfronts)

    Thanks for reporting this. It looks like it’s tied to Dreamhost’s Mod Security configuration (and the fact that there was a ton of info being processed).

    The only way I can think of right now for mitigating this would be to possibly loop over the commit in batches, so if there are 4,000 files, maybe just try to stage 1,000 of them at a time.

    Will look into this further and see if there is anything on the plugin side that can be done about this. Thanks!

    Mika Epstein

    (@ipstenu-dh)

    DreamHost Rep

    418 Unused is us, 100% no doubt, and yes, it’s mod_security saying your string arguments are too long.

    Is all that info being put into the URL?

    Plugin Author Expanded Fronts

    (@expandedfronts)

    @ipstenu-dh Thanks for jumping in on this!

    All of the “staged files” that are being processed are sent via POST, they are all listed in a select in a custom meta box for a custom post type. Revisr doesn’t mess with the default form that gets created by WP for post types or anything like that.

    Then when a commit is published, we hook into the publish_{custom_post_type} action hook to grab the POST-ed staged files and process them.

    So it seems that the actual URL strings won’t be big enough to trigger the issue here, when a commit is published the URL is only modified if there is an error, for example we may add “message=XX” to the URL and redirect back, but I doubt that’s the causing the issue as an additional 10 characters should be fine.

    Also, what’s strange is that the OP mentioned that he was able to stage/unstage files, but they are also initially received via $_POST through AJAX, which seems to be working.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Exceeded number of allowed args on initial commit’ is closed to new replies.