owncloud / core

:cloud: ownCloud web server core (Files, DAV, etc.)
https://owncloud.com
GNU Affero General Public License v3.0
8.37k stars 2.06k forks source link

Fatal error after News app update using core updater #18391

Closed anonimal closed 7 years ago

anonimal commented 9 years ago

Steps to reproduce

  1. Update News app from 5.3.9 to 6.0.1 via the WebUI

    Expected behaviour

Successfully updated app.

Actual behaviour

Breaks owncloud (blank page of death) because of unfulfilled require_once() (files are simply not there).

Server configuration

Operating system: Arch Web server: Apache 2.4.16 Database: MariaDB 10.0.21 PHP version: 5.6.12 ownCloud version: (see ownCloud admin page) 8.1.1 Updated from an older ownCloud or fresh install: Fresh install

Logs

Web server error log

PHP Fatal error:  require_once(): Failed opening required '/usr/share/webapps/owncloud/apps/news/appinfo/../vendor/autoload.php' (include_path='/usr/sha in /usr/share/webapps/owncloud/apps/news/appinfo/app.php on line
 18

ownCloud log (data/owncloud.log)

{"reqId":"E6Y4qFk73598wkF3iggA","remoteAddr":"127.0.0.1","app":"PHP","message":"require_once(\/usr\/share\/webapps\/owncloud\/apps\/news\/appinfo\/..\/vendor\/autoload.php): failed to open stream: No such file or directory at \/usr\/share\/webapps\/owncloud\/apps\/news\/appinfo\/app.php#18","level":3,"time":"2015-08-18T11:53:38+00:00"}
{"reqId":"E6Y4qFk73598wkF3iggA","remoteAddr":"127.0.0.1","app":"PHP","message":"require_once(): Failed opening required '\/usr\/share\/webapps\/owncloud\/apps\/news\/appinfo\/..\/vendor\/autoload.php' (include_path=':\/usr\/sha at \/usr\/share\/webapps\/owncloud\/apps\/news\/appinfo\/app.php#18","level":3,"time":"2015-08-18T11:53:38+00:00"}

Temporary working solution (via git)

1) Remove news app from /apps 2) Clean the app from the database with:

DELETE FROM oc_appconfig WHERE appid = 'news';
DROP TABLE oc_news_items;
DROP TABLE oc_news_feeds;
DROP TABLE oc_news_folders;

3) Clone app directly from the repository and apply appropriate permissions 4) Click ''Enable' in WebUI

News app files provided by updater

See this paste: https://zerobin.net/?c73056692ca37283#VY3LeHqDOvk9kOXsIPyMkwlLnA3WUsmQl9ucu7eIxYU=

Notes

I've uninstalled the app and have done a fresh install of the app (instead of updating) and am given the same errors. Cloning directly from the repo works as expected.

ghost commented 9 years ago

Hi,

had noticed the same and using nearly the same setup as the OP except Debian Jessie instead of Arch and nginx instead of Apache. Manually installing the app from apps.owncloud.com did the trick so it seems the archive is ok but not extracted correctly by the app installer.

karlitschek commented 9 years ago

@Raydiation what do you think?

BernhardPosselt commented 9 years ago

Dup, bug in core ;) https://github.com/owncloud/core/issues/18315

ghost commented 9 years ago

@Raydiation Don't think so. #18315 is about old PHP versions where we both have PHP 5.6 installed.

Manually installing the app is also working so its not an dependency issue. The app archive is just not extraced completely.

BernhardPosselt commented 9 years ago

OK different error it seems

BernhardPosselt commented 9 years ago

No idea then, someone needs to audit the installer code and check what goes wrong.

DeepDiver1975 commented 9 years ago

PHP Fatal error: require_once(): Failed opening required '/usr/share/webapps/owncloud/apps/news/appinfo/../vendor/autoload.php' (include_path='/usr/sha in /usr/share/webapps/owncloud/apps/news/appinfo/app.php on line 18

Well - to be honest - if a file is not there which is expected to be there, it is expected to fall part.

Won't fix from my pov - no ide why the file is missing

BernhardPosselt commented 9 years ago

Package from apps.owncloud.com and git works just fine, same goes for installing over the web interface. Everything works fine from my POV, haven't tried updating though.

DeepDiver1975 commented 9 years ago

See this paste: https://zerobin.net/?c73056692ca37283#VY3LeHqDOvk9kOXsIPyMkwlLnA3WUsmQl9ucu7eIxYU=

the file is missing in this list as well

BernhardPosselt commented 9 years ago

@anonimal btw you can run ./occ news:verify-install to check which files are missing/outdate, see https://github.com/owncloud/news#commands

ghost commented 9 years ago

File was missing here during the update from 5.3.9 to 6.0.0 and also from 6.0.0 to 6.0.1 so this wasn't just a network outtage or similar. This also happened only with the news app. Is there anything different in the news app archive compared to apps like calendar and music?

BernhardPosselt commented 9 years ago

I don't think there's anything out of the ordinary.

ghost commented 9 years ago

Ok. Is there anything what i could do to debug this? I have some time in two days to have a closer look at this.

BernhardPosselt commented 9 years ago

Try to reproduce it reliably :)

BernhardPosselt commented 9 years ago

And post the steps

anonimal commented 9 years ago

@Raydiation running occ on the command line will still throw the same fatal error.

$ sudo -u http php occ news:verify-install
PHP Fatal error: require_once(): Failed opening required '/usr/share/webapps/owncloud/apps/news/appinfo/../vendor/autoload.php' (include_path='/usr/sha in /usr/share/webapps/owncloud/apps/news/appinfo/app.php on line 18

Now, the git version:

$ sudo -u http php occ news:verify-install
 558/558 [============================] 100%

Installation verified, everything OK!
BernhardPosselt commented 9 years ago

@anonimal right, I also need a vendor lib for that, that's why the error is thrown. If you've installed composer you could run

composer dump

inside the news app directory to generate the autoload.php (if the composer.json is there)

In any case the install does not validate :)

anonimal commented 9 years ago

Confirmed: composer dump does not resolve the issue.

BernhardPosselt commented 9 years ago

The verify command should run further after this

anonimal commented 9 years ago

Command returns:

PHP Fatal error:  Class 'OCA\News\Config\AppConfig' not found in /usr/share/webapps/owncloud/apps/news/appinfo/application.php on line 62
BernhardPosselt commented 9 years ago

Ok, forget it, too much is missing apparently.

ghost commented 9 years ago

@Raydiation

Try to reproduce it reliably :) And post the steps

I'm able to reproduce this reliable by following those steps:

  1. Download https://github.com/owncloud/news/archive/6.0.0.tar.gz or https://github.com/owncloud/news/archive/5.3.9.tar.gz
  2. Extract archives to $path/apps/news
  3. Browse http://example.com/index.php/settings/apps
  4. Enable news app 5.3.9/6.0.0
  5. Reload page and have a working news app
  6. Browse http://example.com/index.php/settings/apps
  7. Hit the "update to 6.0.1" button
  8. Reload page
  9. Get WSOD with the log entries of the OP above

There is nothing in the logfiles (even with loglevel 0) expect the ones above.

DeepDiver1975 commented 9 years ago

I was just trying to reproduce this - autoload.php does exist for me after upgrade - but news is broken due to this:

{"reqId":"tLtQkh9nMXKiyT+GVInS","remoteAddr":"::1","app":"index","message":"Exception: {\"Exception\":\"OCP\\\\AppFramework\\\\QueryException\",\"Message\":\"Could not resolve OCA\\\\News\\\\Fetcher\\\\FeedFetcher! Class PicoFeed\\\\Reader\\\\Reader does not exist\",\"Code\":0,\"Trace\":\"#0 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(106): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->resolve('OCA\\\\\\\\News\\\\\\\\Fetche...')\\n#1 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(66): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('OCA\\\\\\\\News\\\\\\\\Fetche...')\\n#2 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(85): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->buildClass(Object(ReflectionClass))\\n#3 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(106): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->resolve('OCA\\\\\\\\News\\\\\\\\Fetche...')\\n#4 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/apps2\\\/news\\\/appinfo\\\/application.php(179): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('OCA\\\\\\\\News\\\\\\\\Fetche...')\\n#5 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/3rdparty\\\/pimple\\\/pimple\\\/src\\\/Pimple\\\/Container.php(112): OCA\\\\News\\\\AppInfo\\\\Application->OCA\\\\News\\\\AppInfo\\\\{closure}(Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer))\\n#6 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(104): Pimple\\\\Container->offsetGet('OCA\\\\\\\\News\\\\\\\\Fetche...')\\n#7 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(66): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('OCA\\\\\\\\News\\\\\\\\Fetche...')\\n#8 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(85): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->buildClass(Object(ReflectionClass))\\n#9 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(106): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->resolve('OCA\\\\\\\\News\\\\\\\\Servic...')\\n#10 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(66): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('OCA\\\\\\\\News\\\\\\\\Servic...')\\n#11 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(85): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->buildClass(Object(ReflectionClass))\\n#12 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(106): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->resolve('OCA\\\\\\\\News\\\\\\\\Contro...')\\n#13 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/app.php(96): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('OCA\\\\\\\\News\\\\\\\\Contro...')\\n#14 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('OCA\\\\\\\\News\\\\\\\\Contro...', 'index', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#15 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#16 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/route\\\/router.php(280): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#17 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/base.php(894): OC\\\\Route\\\\Router->match('\\\/apps\\\/news\\\/fold...')\\n#18 \\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/index.php(40): OC::handleRequest()\\n#19 {main}\",\"File\":\"\\\/home\\\/deepdiver\\\/Development\\\/ownCloud\\\/master\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php\",\"Line\":91}","level":4,"time":"2015-08-21T18:09:30+00:00","method":"GET","url":"\/index.php\/apps\/news\/folders"}
BernhardPosselt commented 9 years ago

So updating randomly deletes files? Maybe race conditions? We are first extracting the archive, then deleting the old one and move the new folder over, right?

DeepDiver1975 commented 9 years ago

After reloading the page it worked without issue.

ghost commented 9 years ago

Just tested with the new release of the Tasks app from 0.7.1 to 0.8.0 which worked without any problem. Few days ago tested the update of the news app from 6.0.1 to 6.0.3 and the same happens.

Is there just anything in the archive of the news app which can't be handled by core? Any known bugs of PHP with extracting archives etc?

BernhardPosselt commented 9 years ago

ZIP vs tar.gz?

ghost commented 9 years ago

Could be. I can't remember if the versions 5.3.9 or below where all also tar.gz or what format have those releases used?

BernhardPosselt commented 9 years ago

We've used tar.gz version 2.x IIRC

MorrisJobke commented 9 years ago

Could be. I can't remember if the versions 5.3.9 or below where all also tar.gz or what format have those releases used?

@RealRancor What distro do you use? Maybe it's a problem with the used libraries.

ghost commented 9 years ago

@MorrisJobke Debian Jessie which has PHP 5.6.13 https://packages.debian.org/jessie/php5

MorrisJobke commented 8 years ago

This will hopefully be gone once https://github.com/owncloud/core/issues/20295 is implemented.

I will close this issue as an duplicate of #20295.

ghost commented 8 years ago

@MorrisJobke I don't think that a failing extraction of an archive will be solved by code signing.

This issue here is caused by the tar.bz2 format used by the new app. Other apps using the .zip format are not showing thid problem.

MorrisJobke commented 8 years ago

@MorrisJobke I don't think that a failing extraction of an archive will be solved by code signing.

Oh ... I thought it was because of a broken (partly) extraction.

MorrisJobke commented 8 years ago

Could be fixed by https://github.com/owncloud/core/pull/20196 which is part of 8.1.5, 8.2.1 and 9.0.0

MorrisJobke commented 8 years ago

Could be fixed by #20196 which is part of 8.1.5, 8.2.1 and 9.0.0

@RealRancor Can I ask you to test this again with one of the above versions?

ghost commented 8 years ago

@MorrisJobke Thanks for the ping, have missed the previous comment.

Just tested with oC 8.2.2 on PHP 5.6.14:

  1. Download https://github.com/owncloud/news/archive/6.1.0.tar.gz
  2. Extract archive into /apps
  3. Enable News 6.1.0
  4. Open "News" from Navigation and have a working news 6.1.0
  5. Open internal appstore
  6. Hit "Update to 6.1.1" button
  7. Open "News" from Navigation and get an Internal Server error

When having a look at filesystem level the /apps/news folder contains only the following folders and files:

appinfo
AUTHORS.md
CHANGELOG.md
command
config
CONTRIBUTING.md
controller
COPYING
cron
css
db
dependencyinjection
fetcher
hooks
img
js
news.iml
templates
vendor

where the full 6.1.1 from https://apps.owncloud.com/content/show.php/News?content=168040 has this list of files and folders in its main dir:

admin
appinfo
AUTHORS.md
bin
build
CHANGELOG.md
command
composer.json
composer.lock
config
CONTRIBUTING.md
controller
COPYING
cron
css
db
dependencyinjection
explore
fetcher
hooks
http
img
js
l10n
.mailmap
news.iml
plugin
README.md
service
templates
utility
vendor

With 8.2.2 there is also now another error:

{"reqId":"A7pc7mjaurORp\/YbsJQ9","remoteAddr":"xxx","app":"index","message":"Exception: {\"Exception\":\"OCP\\\\AppFramework\\\\QueryException\",\"Message\":\"Could not resolve OCA\\\\News\\\\Controller\\\\PageController! Class OCA\\\\News\\\\Explore\\\\RecommendedSites does not exist\",\"Code\":0,\"Trace\":\"#0 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php(106): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->resolve('OCA\\\\\\\\News\\\\\\\\Contro...')\\n#1 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/app.php(96): OC\\\\AppFramework\\\\Utility\\\\SimpleContainer->query('OCA\\\\\\\\News\\\\\\\\Contro...')\\n#2 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/routing\\\/routeactionhandler.php(45): OC\\\\AppFramework\\\\App::main('PageController', 'index', Object(OC\\\\AppFramework\\\\DependencyInjection\\\\DIContainer), Array)\\n#3 [internal function]: OC\\\\AppFramework\\\\routing\\\\RouteActionHandler->__invoke(Array)\\n#4 \\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/route\\\/router.php(291): call_user_func(Object(OC\\\\AppFramework\\\\routing\\\\RouteActionHandler), Array)\\n#5 \\\/var\\\/www\\\/owncloud\\\/lib\\\/base.php(851): OC\\\\Route\\\\Router->match('\\\/apps\\\/news\\\/')\\n#6 \\\/var\\\/www\\\/owncloud\\\/index.php(39): OC::handleRequest()\\n#7 {main}\",\"File\":\"\\\/var\\\/www\\\/owncloud\\\/lib\\\/private\\\/appframework\\\/utility\\\/simplecontainer.php\",\"Line\":91}","level":3,"time":"2016-01-06T15:18:34+01:00"}
ghost commented 8 years ago

Just had another look at this because i have seen https://github.com/owncloud/core/pull/22875

https://github.com/owncloud/core/blob/v8.2.2/resources/config/mimetypemapping.dist.json#L147

has application/x-compressed for tar.gz used by the news app but thats currently not in OC_Archive: https://github.com/owncloud/core/blob/v8.2.2/lib/private/archive.php#L42-L49

I have absolutely no idea about all that stuff but might worth a look?

ghost commented 8 years ago

Re-Tested within an updated environment:

ownCloud 9.0.1 PHP 7.0.5 News 8.2.1

After hitting the update button to 8.3.0 the archive is still not extracted fully (missing files) and causing an internal server error because of this.

Strange enough the News 7.1.2 was pulled/installed successfully to 8.2.1 during the upgrade from ownCloud 8.2.3 to 9.0.1 when running ./occ upgrade. Are there any differences between those two methods?

PVince81 commented 8 years ago

Is this still an issue with recent versions ?

ghost commented 8 years ago

@PVince81 Will re-test once 9.1.1 is out and my productive env is updated to that version

PVince81 commented 7 years ago

User has left github and no feedback from OP, closing

anonimal commented 7 years ago

no feedback from OP

What more was needed of me?

ghost commented 7 years ago

What more was needed of me?

Most likely https://github.com/owncloud/core/issues/18391#issuecomment-239863143 or any other feedback since your last comment 1 1/2 years ago.

They just wanted to close this issue to think they solved it.

What are you trying to achieve with such comments?

anonimal commented 7 years ago

I haven't used owncloud since. I simply got the ball rolling, I'm not an owncloud developer.

lock[bot] commented 5 years ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.