Error PHP74 - Trying to access array offset on value of type null

I was running into this same issue, along with a couple other issues. I’m not sure exactly what step fixed the issue for me, but I modified the php.ini file

post_max_size = 20G

upload_max_filesize = 20G

Originally they were 20GB. I’m not sure if GB was correct or causing problems. Then I had to restart php-fpm. Once I did that the errors stopped filling up my logs.

Or it could just have been restarting php-fpm did the trick.

1 Like

Hi, I also have that error
“trying to access array offset on value of type null at /var/www/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230”

I tried your solutuion but it didn’t work.

Do somebody have a nother solution?

or wait for May 2020
or …

Sorry, but the above will not fix it after all.

This morning, my log file was filled with these errors again. sorry for the false hope.

I updated the original thread as UNsolved.

1 Like

Awaiting update
it’s not much anymore

I too have this issue of “Trying to access array offset on value of type null at /usr/share/nginx/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230” repeated over and over again. I’m running the following system:

CentOS 8.1
Nextcloud 18.0.4
SELINUX enforcing

I’m using a combination of Redis and APCu caching.


Just wanted to pop in and say that I face the same problem. PHP 7.4, NC 18.0.4
For me it spams the log with 3-4 minute intervals, and it spits out about 300-400 lines every time.

1 Like

Same problem for me. Running as a plugin in FreeNAS

1 Like

Same problem on Debian Bullseye, php-7.4.5, postgresql-12.2, nc-

This workaround works for me:

Not only did the above “fix” not work for me, but the single recurring error I had before is now replaced with two recurring errors caused by the Complier.php file.

I would not expect a real fix for this for a while, likely not May (NC19).


Same game over here…

I changed memory_limit lower than 2G and problem was solwed
max_upload_size e.t.c. left as it is…

That doesn’t help the memory limit under 2gb
to change…

Although the configuration of my Nextcloud may be different, I have found that Scanning all files using the files:scan command in occ floods my Nextcloud log with a variant of this error. Seeing how the community could provide valuable information to any developers folowing this topic, it would be great if @Oriann updates the original post by providing the versions of the software used in his installation, to help reduce the number of these errors.

Here are the details of my installation:

The Nextcloud package is installed, using an archive file, on a shared hosting server with some folders connected to external storage.
Nextcloud version: 18.0.4, 18.0.6 => 18.0.7
Operating system and version: Ubuntu 18.04
Apache or nginx version: Apache 2.4.29
PHP version: 7.4.3

The issue you are facing: refer to the first paragraph of my post in this topic.

The output of your Nextcloud log in Admin > Logging:

[PHP Errors] – Trying to access array offset on value of type null at /home/ssh-user/domain.tld/nextcloud/3rdparty/aws/aws-sdk-php/src/RetryMiddleware.php#144

Is this the first time you’ve seen this error? Y

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

$CONFIG = array (
  'instanceid' => 'ocnssr8i2s5s',
  'passwordsalt' => 'unsalted',
  'secret' => 'notso',
  'trusted_domains' =>
  array (
    0 => 'domain.tld',
  'datadirectory' => '/home/ssh-user/domain.tld/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '',
  'overwrite.cli.url' => 'https://domain.tld/nextcloud',
  'dbname' => 'honeysuckle_squirt',
  'dbhost' => '',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'meee',
  'dbpassword' => 'pass12345',
  'installed' => true,
  'maintenance' => false,

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


N.B. Agree with @andyp that the errors persist when upgrading to PHP 7.4 from PHP 7.2, while using a point release following Nextcloud 17.0.1

Issues with deleting, moving, and renaming files - External storage

1 Like

Same error to me after upgrading NC-18.0.10 to PHP-7.2 >> PHP-7.4.11 (HostEurope):

Trying to access array offset on value of type null at /is/htdocs/wp10xxxxxxxxxxxxx/ncw/3rdparty/leafo/scssphp/src/Compiler.php#5230

How to solve this issue?

Thx + regards!

Just small update, I have backed up my data and removed whole nextcloud and installed the latest version 20.0.2 and recovered data. Now theese weird errors are gone forever - uptime 7 days from now.

I suggest others to do the same because nc was somehow bugged in earlier versions and I have faced multiple errors.

EDIT: Using PHP 7.4, nginx 18 only OS changed to Ubuntu, but it should not matter cus I am not installing nc as pkg or apt nor snap


Hi @Oriann

can you maybe share how did you backup ed & restored your data?
I have hundreds of GB of data and multiple user on this service, a copy&paste would be quite terrific to perform.
Thanks for sharing, can’t wait to see this error disappear forever too!

Do you have separate folder for nextcloud data (your data) ? If you have then only backup this folder and reinstall nextcloud. After that edit this line in config.php in /var/www/nextcloud/config/

‘datadirectory’ => ‘/var/www/YOURFOLDERHERE’,

If you have not separated data then you will need to extract it from nextcloud folder. I am not familiar with that because I have done the first option …

Hi Oriann,

thanks for sharing!

I do have a separate folder.
My concern is about the database, if anything in NC20 changes on that regards (tables etc), it should be somehow also upgraded. If the DB gets corrupted the data might not be accessible anymore I believe?

You dont need to do anything with db, you will connect it after reinstalling nc. Just edit the config.php file to match the current config.php after you reinstall. Just match DB and caching things and it should work normally.