presslabs / gitium

Keep all your WordPress code on git with a simple plugin and a repo
https://www.presslabs.com/code/gitium/
GNU General Public License v2.0
180 stars 31 forks source link

Error while trying to merge from Github Repo #184

Closed lime517 closed 4 years ago

lime517 commented 4 years ago

This is the error that appears. There are hundreds of repeat entries of this error in the debug log within a few seconds.

PHP Warning: flock() expects parameter 1 to be resource, bool given in /sites/redacted.dev/files/wp-content/plugins/gitium/functions.php on line 224

Here's what's on line 224: while ( ! flock( $gitium_lock_handle, LOCK_EX | LOCK_NB ) ) {

And $gitium_lock_handle is defined over on line 218: $gitium_lock_handle = fopen( $gitium_lock_path, 'w+' );

fopen() only returns boolean when it fails to open the file. This makes me think this might be a permissions issue?

Any ideas?

cristianuibar commented 4 years ago

Thank you @lime517 for reporting this. This seems to be related to #182. We'll try to address this issue in the following weeks.

This is mainly because /tmp folder is not accessible to Gitium, most likely because you're not on a standard Linux server with a writable /tmp folder? You can check that /tmp is writable for the PHP user and if it exists at all.

DenisFlorin commented 4 years ago

Fixed in #187 by dynamic tmp detection function.