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

value of type null for Compiler.php #18996

Closed
Skip75 opened this issue Jan 19, 2020 · 29 comments
Closed

value of type null for Compiler.php #18996

Skip75 opened this issue Jan 19, 2020 · 29 comments
Labels
0. Needs triage Pending check for reproducibility or if it fits our roadmap bug
Milestone

Comments

@Skip75
Copy link

Skip75 commented Jan 19, 2020

Hello

Getting following error :
Error PHP Trying to access array offset on value of type null at /var/www/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230

On a fresh install of nextcloud 18. Any idea ?

[root@SRV]# php -v
PHP 7.4.1 (cli) (built: Dec 17 2019 16:35:58) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.1, Copyright (c), by Zend Technologies

The nextcloud repo shows a dependency on scssphp 0.7.2.
Maybe an update is needed, since it's an old version...

#scssphp/scssphp#73

@Skip75 Skip75 added 0. Needs triage Pending check for reproducibility or if it fits our roadmap bug labels Jan 19, 2020
@TheMrApostel

This comment has been minimized.

@ckujau
Copy link

ckujau commented Feb 13, 2020

FWIW, while nextcloud/3rdparty/pull/361 upgrades leafo/scssphp to 0.8.4, the 18.0.1-1 release still ships with v0.7.6:

$ pacman -Qo ../nextcloud/3rdparty/leafo/scssphp/src/Version.php 
[...]/nextcloud/3rdparty/leafo/scssphp/src/Version.php is owned by nextcloud 18.0.1-1

$ grep VER ../nextcloud/3rdparty/leafo/scssphp/src/Version.php 
    const VERSION = 'v0.7.6';

$ php-fpm -v | grep ^P
PHP 7.4.2 (fpm-fcgi) (built: Jan 21 2020 18:16:58)

Will this be merged into v18 at all or only in v19?

@tiiiecherle

This comment has been minimized.

@Skip75

This comment has been minimized.

@gabrielebellini

This comment has been minimized.

@quicktrick

This comment has been minimized.

@gabrielebellini

This comment has been minimized.

@quicktrick

This comment has been minimized.

@Oriann

This comment has been minimized.

@quicktrick

This comment has been minimized.

@kesselb
Copy link
Contributor

kesselb commented Feb 18, 2020

If you want to patch this for 18:

nextcloud/3rdparty#386
#19100

@quicktrick
Copy link

If you want to patch this for 18:

nextcloud/3rdparty#386
#19100

 
Excuse me, @kesselb , how can we do it?

/srv/www/nextcloud/3rdparty # wget https://patch-diff.githubusercontent.com/raw/nextcloud/3rdparty/pull/386.patch
/srv/www/nextcloud/3rdparty # git apply --check 386.patch
error: .gitignore: No such file or directory
error: patch failed: composer.json:23
error: composer.json: patch does not apply
error: patch failed: composer.lock:4
error: composer.lock: patch does not apply
error: patch failed: composer/autoload_classmap.php:1180
error: composer/autoload_classmap.php: patch does not apply
error: patch failed: composer/autoload_static.php:1641
error: composer/autoload_static.php: patch does not apply
error: patch failed: composer/installed.json:1641
error: composer/installed.json: patch does not apply
error: patch failed: leafo/scssphp/README.md:1
error: leafo/scssphp/README.md: patch does not apply
error: patch failed: leafo/scssphp/composer.json:1
error: leafo/scssphp/composer.json: patch does not apply
error: patch failed: leafo/scssphp/scss.inc.php:1
error: leafo/scssphp/scss.inc.php: patch does not apply
error: patch failed: leafo/scssphp/src/Block.php:64
error: leafo/scssphp/src/Block.php: patch does not apply
error: leafo/scssphp/src/Cache.php: No such file or directory
error: patch failed: leafo/scssphp/src/Compiler.php:2
error: leafo/scssphp/src/Compiler.php: patch does not apply
error: patch failed: leafo/scssphp/src/Formatter/Compressed.php:63
error: leafo/scssphp/src/Formatter/Compressed.php: patch does not apply
error: patch failed: leafo/scssphp/src/Formatter/Crunched.php:61
error: leafo/scssphp/src/Formatter/Crunched.php: patch does not apply
error: patch failed: leafo/scssphp/src/Parser.php:2
error: leafo/scssphp/src/Parser.php: patch does not apply
error: leafo/scssphp/src/SourceMap/Base64.php: No such file or directory
error: leafo/scssphp/src/SourceMap/Base64VLQ.php: No such file or directory
error: patch failed: leafo/scssphp/src/SourceMap/SourceMapGenerator.php:61
error: leafo/scssphp/src/SourceMap/SourceMapGenerator.php: patch does not apply
error: patch failed: leafo/scssphp/src/Version.php:18
error: leafo/scssphp/src/Version.php: patch does not apply
error: patch failed: composer.json:35
error: composer.json: patch does not apply
error: patch failed: composer.lock:4
error: composer.lock: patch does not apply
error: patch failed: composer/installed.json:3425
error: composer/installed.json: patch does not apply
error: scssphp/scssphp/README.md: No such file or directory
error: scssphp/scssphp/src/Cache.php: No such file or directory
error: scssphp/scssphp/src/Compiler.php: No such file or directory
error: scssphp/scssphp/src/Parser.php: No such file or directory
error: scssphp/scssphp/src/Version.php: No such file or directory

@kesselb
Copy link
Contributor

kesselb commented Feb 18, 2020

Probably easier to use PHP 7.3 until this fix has landed in 18. I guess you have to place the dependency in 3rdparty, remove leafo/scsphp, bump the autoloader and replace the usage of the library with the new one. I don't know why applying the patch is not possible. Maybe the released artifact looks different.

@quicktrick
Copy link

Unfortunately, there is no possibility to downgrade PHP to 7.3 on openSUSE Tumbleweed. There is no such a package in the repository. This is the openSUSE policy -- no obsolete packages.

@Oriann
Copy link

Oriann commented Feb 18, 2020

I can downgrade on FreeBSD 12.1 but if thats just a problem in nextcloud I'll wait then for a fix...

@quicktrick
Copy link

quicktrick commented Mar 12, 2020

After upgrading to 18.0.2.2 the issue still persists.

I guess it won't be fixed until NC 19 Release: 21-05-2020

Maintenance and Release Schedule · nextcloud/server Wiki · GitHub

@kesselb
Copy link
Contributor

kesselb commented Mar 12, 2020

Looks like. Automated backport of the dependency update failed. It's definitely fixed with Nextcloud 19.

@cgzones
Copy link

cgzones commented Mar 24, 2020

These error messages are really annoying.
Can instead of the whole submodule, the single fixing commit please be backported to v18?
scssphp/scssphp@05a5d11

@quicktrick
Copy link

Can instead of the whole submodule, the single fixing commit please be backported to v18?

With what version of NC does it work? It does not work with 18.0.2.2

@cgzones
Copy link

cgzones commented Mar 25, 2020

see nextcloud/3rdparty#425

@quicktrick
Copy link

@cgzones , that commit does not work with 18.0.2.2 either. I'll upgrade to 18.0.3 and try again.

@quicktrick
Copy link

quicktrick commented Mar 25, 2020

And it does not work with 18.0.3.0 either. The browser shows Internal Server Error. And after I return the old Compiler.php, I can see the following errors in the log:

[index] Error: ParseError: syntax error, unexpected ':', expecting ']'

 0. /srv/www/nextcloud/lib/composer/composer/ClassLoader.php line 322
    Composer\Autoload\includeFile("/srv/www/nextcl ... p")
 1. <<closure>>
    Composer\Autoload\ClassLoader->loadClass("Leafo\\ScssPhp\\Compiler")
 2. /srv/www/nextcloud/apps/theming/lib/Util.php line 96
    spl_autoload_call("Leafo\\ScssPhp\\Compiler")
 3. /srv/www/nextcloud/apps/theming/lib/Util.php line 83
    OCA\Theming\Util->calculateLuminance("#0082c9")
 4. /srv/www/nextcloud/apps/theming/lib/Capabilities.php line 80
    OCA\Theming\Util->elementColor("#0082c9")
 5. /srv/www/nextcloud/lib/private/CapabilitiesManager.php line 71
    OCA\Theming\Capabilities->getCapabilities()
 6. /srv/www/nextcloud/lib/private/Template/JSConfigHelper.php line 177
    OC\CapabilitiesManager->getCapabilities()
 7. /srv/www/nextcloud/lib/private/TemplateLayout.php line 190
    OC\Template\JSConfigHelper->getConfig()
 8. /srv/www/nextcloud/lib/private/legacy/template.php line 184
    OC\TemplateLayout->__construct("user", "files")
 9. /srv/www/nextcloud/lib/public/AppFramework/Http/TemplateResponse.php line 167
    OC_Template->fetchPage({usedSpacePercen ... ]})
10. /srv/www/nextcloud/lib/private/AppFramework/Http/Dispatcher.php line 123
    OCP\AppFramework\Http\TemplateResponse->render()
11. /srv/www/nextcloud/lib/private/AppFramework/App.php line 125
    OC\AppFramework\Http\Dispatcher->dispatch(OCA\Files\Controller\ViewController {}, "index")
12. /srv/www/nextcloud/lib/private/AppFramework/Routing/RouteActionHandler.php line 47
    OC\AppFramework\App::main("OCA\\Files\\Controller\\ViewController", "index", OC\AppFramework\ ... {}, {_route: "files.view.index"})
13. <<closure>>
    OC\AppFramework\Routing\RouteActionHandler->__invoke({_route: "files.view.index"})
14. /srv/www/nextcloud/lib/private/Route/Router.php line 299
    call_user_func(OC\AppFramework\ ... {}, {_route: "files.view.index"})
15. /srv/www/nextcloud/lib/base.php line 1008
    OC\Route\Router->match("/apps/files/")
16. /srv/www/nextcloud/index.php line 38
    OC::handleRequest()

@cgzones
Copy link

cgzones commented Mar 25, 2020

Oops, my bad.

I typed 'end-at':-1 instead of 'end-at:-1'

@quicktrick
Copy link

Thank you, @cgzones , it works now! I don't know about the value of type null issue yet, but there are no errors with Compiler.php itself.

@quicktrick
Copy link

I have a couple of errors like this now:

[PHP] Error: Trying to access array offset on value of type bool at /srv/www/nextcloud/apps/files_versions/lib/Storage.php#654

at 2020-03-26T14:40:02+03:00

[PHP] Error: Trying to access array offset on value of type bool at /srv/www/nextcloud/apps/files_versions/lib/Storage.php#653

at 2020-03-26T14:40:02+03:00

The old errors seem to have disappeared.

@MorrisJobke
Copy link
Member

Fixed with #20794

@Skip75
Copy link
Author

Skip75 commented Jun 4, 2020

No upgrade of scssphp for 18.0.5
It seems next upgrade will be merged for NC19. #20794

@Wotisrv
Copy link

Wotisrv commented Jun 10, 2020

This message comes up when opening a document with OnlyOffice.

[PHP 7.4] Error: Trying to access array offset on value of type null at /var/www/html/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230

{"reqId":"XuEu9lh17DyUmWFmXoK0-QAAANc","level":3,"time":"2020-06-10T21:05:27+02:00","remoteAddr":"xx.xx.xx.xx","user":"XXXX","app":"PHP","method":"GET","url":"/index.php/settings/user","message":"Trying to access array offset on value of type null at /var/www/html/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230","userAgent":"Mozilla/5.0 (X11; Fedora; Linux x86_64; rv:77.0) Gecko/20100101 Firefox/77.0","version":"18.0.6.0","id":"5ee12efc2a252"}

@rafny
Copy link

rafny commented Jun 21, 2020

Also reporting the same error message in my logs, but even without opening a documents. My error log is showing this 50+ times per second:
{"reqId":"ddZgZXJOpg8vwwbhKb73","level":3,"time":"2020-06-21T17:28:41+00:00","remoteAddr":"xxx.xxx.xxx.xxx","user":"USER","app":"PHP","method":"GET","url":"/index.php/apps/files/","message":"Trying to access array offset on value of type null at /var/www/nextcloud/3rdparty/leafo/scssphp/src/Compiler.php#5230","userAgent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:77.0) Gecko/20100101 Firefox/77.0","version":"18.0.6.0"}

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