I have a new and different 500 Error

Nextcloud version (eg, 20.0.5): 20.0.6
Operating system and version (eg, Ubuntu 20.04): Unsure; on Dreamhost
Apache or nginx version (eg, Apache 2.4.25): Apache2x (PHPinfo doesn’t show the full Apache version)
PHP version (eg, 7.4): 7.4

The issue you are facing:

I have a handful of different calendars, one of which as stopped syncing. When I run vdirsyncer sync it syncs most of my calendars just fine but for this one I’m getting:

Copying (uploading) item be2e9f5e-2140-4898-b173-ca4c2fe05ba8 to nextcloud_calendars/logistics
error: Unknown error occured for calendars/logistics: 500 Server Error: Internal Server Error for url: https://example.com/nextcloud/remote.php/caldav/calendars/user/logistics/be2e9f5e-2140-4898-b173-ca4c2fe05ba8.ics
error: Use `-vdebug` to see the full traceback.
error: 1 out of 12 tasks failed.

I’m also getting a 500 Server Error when I try to sync with Davx on Android.

Is this the first time you’ve seen this error? (Y/N): Sort of. I was getting a possibly related error two weeks ago. I’m not sure whether or not this is different.

I do see a lot of this at https://example.com/nextcloud/index.php/settings/admin/logging

preg_replace(): Allocation of JIT memory failed, PCRE JIT will be disabled. This is likely caused by security restrictions. Either grant PHP permission to allocate executable memory, or set pcre.jit=0 at /home/user/example/nextcloud/lib/private/DB/AdapterSqlite.php#46

The output of your Nextcloud log in Admin > Logging:

https://paste.ubuntu.com/p/pvGMcvXcxG/

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

<?php
$CONFIG = array (
  'instanceid' => 'occ7c1677a99',
  'passwordsalt' => 'redacted',
  'trusted_domains' => 
  array (
    0 => 'example.com',
    1 => 'www.example.com',
  ),
  'datadirectory' => '/home/abh/nextcloud/data',
  'overwrite.cli.url' => 'https://example.com/nextcloud',
  'dbtype' => 'sqlite3',
  'version' => '20.0.5.2',
  'installed' => true,
  'theme' => '',
  'maintenance' => false,
  'secret' => 'redacted',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_from_address' => 'nextcloud',
  'mail_domain' => 'example.com',
  'mail_smtpauthtype' => 'PLAIN',
  'mail_smtphost' => 'mail.example.com',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '587',
  'mail_smtpname' => 'also_redacted',
  'mail_smtppassword' => 'redacted',
  'loglevel' => 2,
  'trashbin_retention_obligation' => 'auto',
  'defaultapp' => 'calendar',
  'session_lifetime' => 86400,
  'updater.release.channel' => 'stable',
);

The output of your Apache/nginx/system log in /var/log/____:

PASTE HERE

Thankfully, Dreamhost has been super responsive on this.

On Tue, Jan 26, 2021 at 11:17:58PM -0800, DreamHost Customer Support Team wrote:
Hello, 

Thank you for contacting us again! I have responded below. 

On Tue, 26 Jan 2021, you wrote:

> Quaria recently resolved an issue where my next cloud calendars
> weren't syncing because of a modsecurity issue. 
> 
> The fix worked great for ~11 days but the issue seems to be back
> (kind of). It is a bit different in terms of how sync is failing but
> it's still giving me a 500 error and showing me a ton of errors that
> say:
> 
> 
> [ERROR OMITTED FOR BREVITY]
> 


I'm sorry for the recurring problems you are having with your Nextcloud
installation, redacted! That error message is actually just a PHP Warning
and can be removed with a minor modification to the
'/home/user/.php/7.4/phprc' file as detailed in our knowledge base article
below. 


https://help.dreamhost.com/hc/en-us/articles/217253517-PHP-7-overview


As a one-time courtesy I've already made that change for you. However in
looking for other errors outside of that issue, I did notice additional
mod_security related errors from your public IP address
('192.184.142.33') that are likely the cause of these problems. Here's an
example of one of the errors. 


[0 user@andy example]$ grep 192.184.142.33
~/logs/example.info/*/error.log | grep -v "PHP Warning" | tail -1
/home/user/logs/example.info/https/error.log:[Tue Jan 26
21:49:16.329943 2021] [:error] [pid 23364:tid 3485273671424] [client
192.184.142.33:42687] [client 192.184.142.33] ModSecurity: Warning.
Operator GE matched 7 at TX:inbound_anomaly_score. [file
"/dh/apache2/template/etc/mod_sec3_CRS/RESPONSE-980-CORRELATION.conf"]
[line "87"] [id "980130"] [msg "Inbound Anomaly Score Exceeded (Total
Inbound Score: 20 -
SQLI=5,XSS=0,RFI=0,LFI=0,RCE=0,PHPI=0,HTTP=10,SESS=0): individual
paranoia level scores: 20, 0, 0, 0"] [ver "OWASP_CRS/3.3.0"] [tag
"event-correlation"] [hostname "example.info"] [uri
"/nextcloud/remote.php/dav/calendars/redacted/redacted_shared_by_redacted/02aa2be8-2b6a-4f35-864e-20d19b42ec54.ics"]
[unique_id "YBD@3ObxSmHRQbYwCxPVIAAAAAU"]


I've added another exception to that site now which should hopefully
prevent those errors from occurring going forward, but if you continue to
receive 500 response codes / errors when using Nextcloud, please write
back to us and we will investigate further. 

Thanks!