Trying to activate app on production stable9, doesn’t work (dependency analyzer) #23668

Closed
jancborchardt opened this Issue Mar 30, 2016 · 12 comments

Projects

None yet

4 participants

@jancborchardt
Member

It seems to be enabled, but doesn’t show in the app switcher. (News app in this case) owncloud.log:

[
  {
    "reqId": "G4dZm8Xq\/Ayl5vyBzPgc",
    "remoteAddr": "93.202.88.105",
    "app": "PHP",
    "message": "Argument 1 passed to OC\\App\\DependencyAnalyzer::analyze() must be of the type array, null given, called in \/lib\/private\/app.php on line 1100 and defined at \/lib\/private\/app\/dependencyanalyzer.php#52",
    "level": 3,
    "time": "2016-03-30T16:41:44+00:00",
    "method": "POST",
    "url": "\/index.php\/settings\/ajax\/enableapp.php",
    "user": "jan"
  },
  {
    "reqId": "G4dZm8Xq\/Ayl5vyBzPgc",
    "remoteAddr": "93.202.88.105",
    "app": "PHP",
    "message": "Argument 2 passed to OC\\App\\DependencyAnalyzer::analyzeOC() must be of the type array, null given, called in \/lib\/private\/app\/dependencyanalyzer.php on line 66 and defined at \/lib\/private\/app\/dependencyanalyzer.php#280",
    "level": 3,
    "time": "2016-03-30T16:41:44+00:00",
    "method": "POST",
    "url": "\/index.php\/settings\/ajax\/enableapp.php",
    "user": "jan"
  }
]

@DeepDiver1975 @BernhardPosselt any idea?

@jancborchardt jancborchardt added the bug label Mar 30, 2016
@BernhardPosselt
Contributor

Can't reproduce btw

@jancborchardt
Member

@BernhardPosselt well … I use ownCloud with MySQL. And core as well as all the other apps work. News should support the normal setup as well.

@BernhardPosselt
Contributor

I'm using postgres and sqlite, did not check on MySql but I doubt thats the issue

@BernhardPosselt
Contributor
@BernhardPosselt
Contributor

Here is the statement that breaks it: https://github.com/owncloud/core/blob/stable9/lib/private/app.php#L618 which was added by @MorrisJobke ef49f6e ;)

@BernhardPosselt
Contributor

@jancborchardt probably related to the issue it fixes, aka open_basedir ;) yw

@BernhardPosselt
Contributor

BTW, this is the reason why mixing booleans, nulls and other types sucks. It is not obvious after various levels of nesting which values can actually be returned where and less often used paths in your program lead to bugs. Furthermore it makes no sense to return false when running a method called getAppPath().

What's that even supposed to mean? The app path is false? If it means that it could not be calculated because an error occured, throw an exception. If the app path does not exist on the filesystem there are multiple solutions: throw an exception (like a file not found exception or io error which is pretty common in other languages) or maybe return null or an empty Optional. But please don't return false ;D

Although PHP is a weakly typed language you should add some rules for having only one return type, add static analysis and maybe take a look at the Optional pattern. cc @DeepDiver1975

@MorrisJobke
Member

What's that even supposed to mean? The app path is false? If it means that it could not be calculated because an error occured, throw an exception. If the app path does not exist on the filesystem there are multiple solutions: throw an exception (like a file not found exception or io error which is pretty common in other languages) or maybe return null or an empty Optional. But please don't return false ;D

It's not that we don't know it. It's only not simply possible to fix everything from instant. We are working on this, but it's not a easy one-shot task.

@BernhardPosselt
Contributor

@MorrisJobke i know ;)

@MorrisJobke
Member

Fix is in #23676

@MorrisJobke MorrisJobke added this to the 9.1-current milestone Mar 31, 2016
@MorrisJobke MorrisJobke removed their assignment Mar 31, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment