server icon indicating copy to clipboard operation
server copied to clipboard

Error:Trying to access array offset on value of type null; PHP 7.4; Compiler.php

Open LHollyfeld opened this issue 6 years ago • 1 comments

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Steps to reproduce

  1. Login at Nextcloud 18.xx or 19.0.0Beta6 2. 3.

Expected behaviour

Error in the nextcloud.log

Actual behaviour

Tell us what happens instead

Server configuration

Operating system: Ubuntu 20.04 Web server: Apache2 Database: mysql PHP version: 7.4 Nextcloud version: (see Nextcloud admin page) 18.0.4 and 19.0.0Beta6 Updated from an older Nextcloud/ownCloud or fresh install:

Where did you install Nextcloud from:

Signing status:

Signing status
Login as admin user into your Nextcloud and access 
http://example.com/index.php/settings/integrity/failed 
paste the results here.

List of activated apps:

App list
If you have access to your command line run e.g.:
sudo -u www-data php occ app:list
from within your Nextcloud installation folder

Nextcloud configuration:

Config report
If you have access to your command line run e.g.:
sudo -u www-data php occ config:list system
from within your Nextcloud installation folder

or 

Insert your config.php content here. 
Make sure to remove all sensitive content such as passwords. (e.g. database password, passwordsalt, secret, smtp password, …)

Are you using external storage, if yes which one: local/smb/sftp/...

Are you using encryption: yes/no

Are you using an external user-backend, if yes which one: LDAP/ActiveDirectory/Webdav/...

LDAP configuration (delete this part if not used)

LDAP config
With access to your command line run e.g.:
sudo -u www-data php occ ldap:show-config
from within your Nextcloud installation folder

Without access to your command line download the data/owncloud.db to your local
computer or access your SQL server remotely and run the select query:
SELECT * FROM `oc_appconfig` WHERE `appid` = 'user_ldap';


Eventually replace sensitive data as the name/IP-address of your LDAP server or groups.

Client configuration

Browser: Firefox Operating system: Windows 10

Logs

Web server error log

Web server error log
Insert your webserver log here

Nextcloud log (data/nextcloud.log)

Nextcloud log
Insert your Nextcloud log here

{"reqId":"RzPqOmoCjPiD1SkhJ14P","level":3,"time":"2020-05-01T14:26:24+02:00","remoteAddr":"192.168.10.180","user":"--","app":"PHP","method": "GET","url":"/nextcloud/index.php/apps/theming/styles?v=15","message":"Trying to access array offset on value of type null at /var/www/nextc loud/3rdparty/scssphp/scssphp/src/Compiler.php#6189","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:75.0) Gecko/20100101 Firefox/ 75.0","version":"19.0.0.7"}

Browser log

Browser log
Insert your browser log here, this could for example include:

a) The javascript console log
b) The network log
c) ...

I make changes in the file /var/www/nextcloud/3rdparty/scssphp/scssphp/src/Compiler.php from https://github.com/scssphp/scssphp/blob/master/src/Compiler.php

6173c6173 < protected static $libStrSlice = ['string', 'start-at', 'end-at:null'];

protected static $libStrSlice = ['string', 'start-at', 'end-at:-1'];

6189c6189 < $end = (int) $args[2][1];

    $end    = isset($args[2]) ? (int) $args[2][1] : -1;

and now, no errors in the log.

LHollyfeld avatar May 01 '20 12:05 LHollyfeld

Closing this issue as duplicate of #18996. Please always use the search to find similar issues first.

I'm also using https://github.com/scssphp/scssphp/commit/05a5d11ea7f68c52fdb6a5ca35cf46613b608445 on my production instance. That seems to work quite well.

Best would be to update scssphp but that breaks something: https://github.com/nextcloud/server/pull/20713.

Mind to send a pull request to https://github.com/nextcloud/3rdparty with the patch for scssphp?

kesselb avatar May 01 '20 17:05 kesselb