cotech / website

The Cooperative Technologists WordPress website
https://www.coops.tech/
GNU General Public License v3.0
24 stars 5 forks source link

Oops we broke the site #79

Closed chriscroome closed 6 years ago

chriscroome commented 6 years ago

The live and dev sites are generating errors, for the dev site we have this in the Apache error logs when you try to load the front page:

PHP Warning:  require_once(/home/cotechdev/sites/vendor/autoload.php): failed to open stream: No such file or directory in /home/cotechdev/sites/web/wp-config.php on line 7

And line 7 of wp-config.php is:

require_once(dirname(__DIR__) . '/vendor/autoload.php');

And this file is here:

pwd
/home/cotechdev/sites/web
find ./ -name autoload.php
./app/plugins/posts-to-posts/vendor/scribu/lib-posts-to-posts/autoload.php
./app/themes/coop-tech-oowp-theme/vendor/autoload.php

Anyone have any suggestions regarding fixing this?

chriscroome commented 6 years ago

The cron job that runs this script to which @nicksellen added:

 # Remove any untracked files/directories
git clean -fd

Looks like it might have caused this:

Date: Thu, 30 Nov 2017 16:23:02 +0000
From: Cron Daemon <root@webarch1.co.uk>
To: cotechdev@webarch1.co.uk
Subject: Cron <cotechdev@webarch1> /home/cotechdev/bin/cron

Removing vendor/
chriscroome commented 6 years ago

So removing git clean -fd and running the update script fixed the sites.

nicksellen commented 6 years ago

Oops! Anything that is needed should either be in the repo, or in a .gitignore entry. I'll make a PR :)

nicksellen commented 6 years ago

Oh, it's already in there. Running git clean -fd locally does not remove the vendor directory :/

chriscroome commented 6 years ago

That's weird, why would it happen on the server?

nicksellen commented 6 years ago

That's weird, why would it happen on the server?

I don't know, I would have to poke around on the server I think...

nicksellen commented 6 years ago

Seems it was a bug in git that was fixed in version 2.13.2 (debian stretch is on 2.11.0):

  • "git clean -d" used to clean directories that has ignored files, even though the command should not lose ignored ones without "-x". "git status --ignored" did not list ignored and untracked files without "-uall". These have been corrected.

https://github.com/git/git/blob/e629a7d28a405e48fae6b064a781a10e885159fc/Documentation/RelNotes/2.13.2.txt#L24-L27

chriscroome commented 6 years ago

Thanks for finding that 😃.