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

IIS: config.php gets cleared/reset after sometime when upgrading #12263

Closed
ev0lister opened this issue Nov 18, 2014 · 20 comments
Closed

IIS: config.php gets cleared/reset after sometime when upgrading #12263

ev0lister opened this issue Nov 18, 2014 · 20 comments

Comments

@ev0lister
Copy link

ev0lister commented Nov 18, 2014

Config file gets cleared after some time.

Steps to reproduce

  1. Update from 7.0.2 to 7.0.3

Expected behaviour

config.php should not be initialized after some time

Actual behaviour

After upgrade from 7.0.2 to 7.0.3 everything works as usual, but then some time later (not yet known when and why) the config.php gets overwritten by OC.

config.php initialized with the following content:

<?php
$CONFIG = array (
'instanceid' => 'xxxxxxxxx',
);

You can replace this one with an backup of the config file and everything works again, however after sometime same issue occurs.

Server configuration

Operating system: Windows 2012 R2

Web server: IIS 8

Database: MySQL

PHP version: PHP 5.5

ownCloud version: 7.0.3 (stable)

Updated from an older ownCloud or fresh install: Updated

List of activated apps: Only default

The content of config/config.php:

<?php
$CONFIG = array (
  'instanceid' => '51bXXXX0ec9',
  'passwordsalt' => '*** Removed for security reasons',
  'trusted_domains' => 
  array (
    0 => 'XXX',
    1 => 'XXX',
  ),
  'overwritewebroot' => '/oc',
  'datadirectory' => 'XXXX',
  'dbtype' => 'mysql',
  'version' => '7.0.3.4',
  'dbname' => 'owncloud',
  'dbhost' => '127.0.0.1',
  'dbtableprefix' => 'oc_',
  'dbuser' => 'owncloud',
  'dbpassword' => '*** Removed for security reasons',
  'installed' => true,
  'forcessl' => true,
  'mail_from_address' => 'noreply',
  'mail_smtpmode' => 'php',
  'mail_domain' => 'XXXX',
  'loglevel' => '2',
  'theme' => '',
  'maintenance' => false,
);

Are you using external storage, if yes which one: No

Are you using encryption: No

Client configuration

Browser: Firefox, current version

Operating system: Windows 8

Logs

Web server error log

No log

ownCloud log (data/owncloud.log)

No log entries around time of overwriting config.php

Browser log

Not relevant

Please note: config.php gets at least touched every minute or so.. seems not to be OK.

@LukasReschke
Copy link
Member

Most likely #11843 (comment)

@karlitschek @craigpg @PVince81 FYI

@ev0lister
Copy link
Author

Btw. write protecting the config.php is not a workaround as then OC is yelling for r/w permissions.

@LukasReschke LukasReschke changed the title config.php gets initialized after sometime when upgrading to 7.0.3 IIS: config.php gets cleared/reset after sometime when upgrading Nov 18, 2014
@LukasReschke
Copy link
Member

@ev0lister As a workaround (read: far away from being a patch) I would recommend you to apply the changes from #12139 (click on "Files" then you see the changes)

After applying that patch you should be able again to make the config read-only. But obviously this is still a valid bug being caused by the implementation of PHP on Windows so please keep this issue open.
(Or even better: Migrate to a linux-based setup since this is what most developers and users use)

@ev0lister
Copy link
Author

@LukasReschke Thanks! Have implemented that workaround and looks fine so far. Will report in case I face any issues. As a side note: I'm aware that Linux is the preferred system for OC, however so far it was always possible to use it on Windows, so would definitively be nice to be able to keep that running :-)

@LukasReschke
Copy link
Member

@ev0lister Can you remember if you was logged-in with an admin account when this happened? - Or was this an account without admin privileges?

@ev0lister
Copy link
Author

I'm using an admin account - must be this one as there is only one other user on this instance.

@matthiasjost
Copy link

I can reproduce the same behaviour ony my Windows 2012 server machine. The file gets overwritten. It happens always after a request. Which seems to make sense as cron jobs are configured to be handled during the ajax request.

@LukasReschke
Copy link
Member

@jnfrmarks Any chance to test 7.0.2 -> 7.0.3 on IIS and then clicking around a little bit? - Would be interesting if we can reproduce this internally.

@jnfrmarks
Copy link

@LukasReschke @ev0lister

What steps were taken for the upgrade? If I remember correctly, there is a manual step that needs to happen around the DB when upgrading windows.

@LukasReschke
Copy link
Member

What steps were taken for the upgrade? If I remember correctly, there is a manual step that needs to happen around the DB when upgrading windows.

The manual steps are only required for MSSQL, IIS is as usual. - Replace old files and click "update".

@matthiasjost
Copy link

Would this happen on apache (windows) too? Or is it related to IIS? I think it depends on the PHP windows implementation. Is this true?

@LukasReschke
Copy link
Member

I'm not quite sure. Single-threaded PHP running Apache might work. - Though once you use Apache there is really no reason not to run it on a *nix system directly.

@matthiasjost
Copy link

It seems to be difficult anyway to have a good apache setup on windows. As xampp should not be used in production environment. And The apache haus windows binaries are also just a bunch of binaries that need to be configured in every detail. I think I will use IIS to proceed.

@ev0lister
Copy link
Author

Hey guys, what about the current release of OC (7.0.4). In changelog I can see that config.php can be read-only. Would that fix / workaround this issue? I can test that later but maybe you already have the answer..

@LukasReschke
Copy link
Member

Hey guys, what about the current release of OC (7.0.4). In changelog I can see that config.php can be read-only. Would that fix / workaround this issue? I can test that later but maybe you already have the answer..

Yes. You can try setting 'config_is_read_only' => true, in your config.php and make the file read-only for the IIS process. - That should work. (though some features such as modifying settings via GUI are not possible anymore)

@ev0lister
Copy link
Author

Have upgraded to 7.0.4 without setting the config_is_read_only parameter and have no issues now on IIS.

@LukasReschke
Copy link
Member

@ev0lister That's the fun with this bug. It happens not in every case - much fun to debug ;-)

@matthiasjost
Copy link

Is this bug still open in 7.0.4? (https://owncloud.org/changelog/)

@LukasReschke
Copy link
Member

7.0.4 might still be affected. We did some changes to ownCloud 8 in regard to config handlig so you might try the beta and report back.

@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.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants