Skip to content

PHP Fatal error: Class 'OC_Mount_Config' not found #22641

Closed

Description

@felixboehm

Steps to reproduce

  1. fresh install from tar, put code in place
  2. setup with script below
su www-data -s /bin/bash -c 'php occ  maintenance:install --database "mysql" --database-name "owncloud"  --database-host "mariadb" --database-user "root" --database-pass "secret" --admin-user "admin" --admin-pass "password" --data-dir "/mnt/data"'

su www-data -s /bin/bash -c "php occ config:system:set overwrite.cli.url --value http://mydomain"

Expected behaviour

occ command to set overwrite.cli.url should run without throwing PHP Fatal error.

Actual behaviour

Command line output:

ownCloud is not installed - only a limited number of commands are available
ownCloud was successfully installed
PHP Fatal error:  Class 'OC_Mount_Config' not found in /var/www/owncloud/lib/private/server.php on line 1238

Logfile:

{"reqId":"8qFxHc2nvaJz0B6ewS+D","remoteAddr":"","app":"PHP","message":"Class 'OC_Mount_Config' not found at \/var\/www\/owncloud\/lib\/private\/server.php#1238","level":3,"time":"2016-02-25T10:11:46+00:00"}

Note:

  • Running the command again works then.
  • Waiting doesn't help, no timing issue.

Server configuration

Operating system: Ubuntu 14.04

Web server: Apache

Database: MariaDB remote

PHP version: PHP 5.5.9

ownCloud version: 9.0.0 beta2

List of activated apps: default

The content of config/config.php: default

Activity

  1. added this to the milestone on Feb 25, 2016
  2. MorrisJobke commented on Feb 25, 2016

    @MorrisJobke
    Contributor

    fresh install from tar

    Link please.

  3. felixboehm commented on Feb 25, 2016

    @felixboehm
    ContributorAuthor
  4. davitol commented on Jul 1, 2016

    @davitol
    Contributor

    I reopen this issue due to it is still happening in "9.1.0.11","versionstring":"9.1.0 RC1","edition":"Enterprise"}

    Steps to reproduce:

    1. In a fresh install run for example sudo -u www-data ./occ files_external

    The 1st time a occ command is run, the following log appears:

    PHP Fatal error:  Class 'OC_Mount_Config' not found in /opt/owncloud/apps/windows_network_drive/appinfo/register_command.php on line 24
    
  5. reopened this on Jul 1, 2016
  6. modified the milestones: , 9.0 on Jul 1, 2016
  7. DeepDiver1975 commented on Jul 1, 2016

    @DeepDiver1975
    Contributor

    @davitol I cannot reproduce this 😢

  8. SergioBertolinSG commented on Jul 1, 2016

    @SergioBertolinSG
    Contributor

    I've seen this using 9.0.1 EE,
    before logging with any user, run sudo -u www-data ./occ
    The first time it fails and says 'OC_Mount_Config' not found. A second run works.
    Not happening in 9.1.0RC1 though.

  9. DeepDiver1975 commented on Jul 1, 2016

    @DeepDiver1975
    Contributor

    grrrr ... this is pure non-sense:
    https://github.com/owncloud/core/blob/master/lib/private/Server.php#L1324-L1353

    oc_mount_config lives in files_external - if this app is not loaded it will crash

  10. self-assigned this
    on Jul 1, 2016
  11. DeepDiver1975 commented on Jul 1, 2016

    @DeepDiver1975
    Contributor

    easiest thing would be to disallow deactivation of files_external

  12. 11 remaining items

  13. PVince81 commented on Nov 30, 2016

    @PVince81
    Contributor

    Should not happen any more on master... Should we close or do you guys need a backportable quickfix ?

  14. PVince81 commented on Dec 6, 2016

    @PVince81
    Contributor

    ok then, I'll close. Thanks

  15. PVince81 commented on Feb 3, 2017

    @PVince81
    Contributor

    Reopening. It is not possible to use "occ maintenance:install" with EE and WND due to this.

  16. modified the milestones: 9.1.5, 9.1.3 on Feb 3, 2017
  17. PVince81 commented on Feb 3, 2017

    @PVince81
    Contributor

    Okay, here is what happens:

    1. During "occ maintenance:install", apparently the WND app enables itself but it doesn't auto-enable files_external
    2. During "occ config:system" the register_command from WND tries to access files_external namespace directly without checks. Somehow it seems that the "app.php" was run too, so the code that enabled files_external does run, but not in a way that properly initializes the files_external app namespace.
    3. Running "occ config:system" again works because here the files_external app is enabled so its namespace is properly initialized.

    Since this is a hacky mess, I'll fix the WND app to auto-enable files_external at the time the app becomes enabled in "appinfo/install.php". I hope this is called for bundled apps...

    If that doesn't work, add explicit code in "register_command.php" in WND to make sure the files_external namespace is loaded.

  18. PVince81 commented on Feb 3, 2017

    @PVince81
    Contributor

    For previous versions, the workaround is to run "occ" once without any args and let it fail.
    Subsequent calls to "occ" will then work.

  19. PVince81 commented on Feb 3, 2017

    @PVince81
    Contributor
  20. lock commented on Aug 2, 2019

    @lock

    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.

  21. locked as resolved and limited conversation to collaborators on Aug 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions