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

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

Closed
felixboehm opened this issue Feb 25, 2016 · 16 comments
Closed

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

felixboehm opened this issue Feb 25, 2016 · 16 comments
Assignees
Milestone

Comments

@felixboehm
Copy link
Contributor

felixboehm commented Feb 25, 2016

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

@butonic butonic added this to the 9.0-current milestone Feb 25, 2016
@MorrisJobke
Copy link
Contributor

fresh install from tar

Link please.

@felixboehm
Copy link
Contributor Author

Ohh - retested: No issue in community beta2: http://download.owncloud.org/community/testing/owncloud-9.0.0beta2.tar.bz2

Only in enterprise tar. Thought there should not be a difference.

@davitol
Copy link
Contributor

davitol commented Jul 1, 2016

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

@davitol davitol reopened this Jul 1, 2016
@davitol davitol modified the milestones: 9.1-current, 9.0 Jul 1, 2016
@DeepDiver1975
Copy link
Member

@davitol I cannot reproduce this 😢

@SergioBertolinSG
Copy link
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.

@DeepDiver1975
Copy link
Member

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

@DeepDiver1975 DeepDiver1975 self-assigned this Jul 1, 2016
@DeepDiver1975
Copy link
Member

easiest thing would be to disallow deactivation of files_external

@PVince81
Copy link
Contributor

PVince81 commented Jul 6, 2016

@DeepDiver1975 since this bug is about installing OC, maybe we could just set enable to true in the info xml for files_external ?

@PVince81 PVince81 modified the milestones: 9.1, 9.1.1 Jul 18, 2016
@PVince81 PVince81 modified the milestones: 9.1.2, 9.1.1 Sep 21, 2016
@butonic
Copy link
Member

butonic commented Oct 13, 2016

I can reproduce this happens when windows_network_drive is present and you run make test.

@PVince81 PVince81 modified the milestones: 9.1.3, 9.1.2 Oct 20, 2016
@PVince81
Copy link
Contributor

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

@PVince81
Copy link
Contributor

PVince81 commented Dec 6, 2016

ok then, I'll close. Thanks

@PVince81 PVince81 closed this as completed Dec 6, 2016
@PVince81
Copy link
Contributor

PVince81 commented Feb 3, 2017

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

@PVince81 PVince81 reopened this Feb 3, 2017
@PVince81 PVince81 modified the milestones: 9.1.5, 9.1.3 Feb 3, 2017
@PVince81 PVince81 assigned PVince81 and unassigned DeepDiver1975 Feb 3, 2017
@PVince81
Copy link
Contributor

PVince81 commented Feb 3, 2017

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.

@PVince81
Copy link
Contributor

PVince81 commented Feb 3, 2017

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

@PVince81
Copy link
Contributor

PVince81 commented Feb 3, 2017

Fix for WND: https://github.com/owncloud/windows_network_drive/pull/79 using "appinfo/install.php" approach. That did the trick!

@lock
Copy link

lock bot commented Aug 2, 2019

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.

@lock lock bot locked as resolved and limited conversation to collaborators Aug 2, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants