config.json is wiping itself down #47

Closed
opened 2020-05-22 06:31:43 +00:00 by Ghost · 2 comments

approx every 1.5-2 weeks, it just wipes itself down to something like:

{[]}

It happened 2 times since I started using greenlock (1.5 month ago). I thought it's some sort of malicious attempts, until the very same happened on my staging server which is strictly accessible by dev team only.

Please ask me questions as I have no clue where to start investigating this issue. All my servers are dedicated-standalone, no other services are up. I don't think hardware matters, so I omit it. My setup is quite classic, except I use manager to control config, I use things like this:

        greenlock.remove({
          subject: old_url
        });
        greenlock.add({
          subject: company.url,
          altnames: [company.url]
        });

parts of teh app (server.js):

...
  greenlock = require('greenlock-express'),
  greenlockCommon = require('./server_greenlock_common'),
...
if (config.server.ssl.enabled) {
  greenlock.init(greenlockCommon).serve(app);
} else {

and server_greenlock_common.js:

const pkg = require('./package.json'),
  os = require('os');

module.exports = {
  packageRoot: __dirname,
  configDir: os.homedir() + '/.greenlock',
  maintainerEmail: pkg.author.email,
  packageAgent: pkg.name + '/' + pkg.version,
  cluster: false
};
approx every 1.5-2 weeks, it just wipes itself down to something like: > {[]} It happened 2 times since I started using greenlock (1.5 month ago). I thought it's some sort of malicious attempts, until the very same happened on my staging server which is strictly accessible by dev team only. Please ask me questions as I have no clue where to start investigating this issue. All my servers are dedicated-standalone, no other services are up. I don't think hardware matters, so I omit it. My setup is quite classic, except I use manager to control config, I use things like this: ``` greenlock.remove({ subject: old_url }); greenlock.add({ subject: company.url, altnames: [company.url] }); ``` parts of teh app (server.js): ``` ... greenlock = require('greenlock-express'), greenlockCommon = require('./server_greenlock_common'), ... if (config.server.ssl.enabled) { greenlock.init(greenlockCommon).serve(app); } else { ``` and server_greenlock_common.js: ``` const pkg = require('./package.json'), os = require('os'); module.exports = { packageRoot: __dirname, configDir: os.homedir() + '/.greenlock', maintainerEmail: pkg.author.email, packageAgent: pkg.name + '/' + pkg.version, cluster: false }; ```
Ghost changed title from config.json is wiping itself up to config.json is wiping itself down 2020-05-22 06:32:03 +00:00
Owner

I could have sworn we had a thread about this... I must have dreamt it.

I believe that it's most likely that either permissions are changing (i.e. being run sometimes as a user and sometimes as root), or the volume is being remounted between read-only and read-write.

It's also possible that you are running multiple instances on the same config directory, and they are fighting against each other.

The only time that the config file will become {} is when it is corrupt and has to be re-written.

In what I remember from the thread I thought we had, it ended up being an issue with Docker mounted volumes.

I could have sworn we had a thread about this... I must have dreamt it. I believe that it's most likely that either permissions are changing (i.e. being run sometimes as a user and sometimes as root), or the volume is being remounted between read-only and read-write. It's also possible that you are running multiple instances on the same config directory, and they are fighting against each other. The only time that the config file will become `{}` is when it is corrupt and has to be re-written. In what I remember from the thread I thought we had, it ended up being an issue with Docker mounted volumes.
Owner

Closing due to inactivity.

Closing due to inactivity.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: root/greenlock-express.js#47
No description provided.