Update custombuild get error : Undefined variable $filePath

This is it

Verified User
Joined
Feb 12, 2017
Messages
27
Undefined variable $filePath in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 15

then process keeps running nothing happens (update: reloading the page seems the update has finished, however all other updates of other updates give same error)

what to do?
 
Last edited:
I have the same issue going on for a while. It's just a warning, not an error so custombuild is still updating everything. Does anyone has a solution for this warning?

Update: This file seems to be a PHP-file. I think the solution is to put line 16 before line 15.
 
Last edited:
I have the same issue going on for a while. It's just a warning, not an error so custombuild is still updating everything. Does anyone has a solution for this warning?

Update: This file seems to be a PHP-file. I think the solution is to put line 16 before line 15.
Seems like it's a minor glitch protecting everyone from a major error. Swapping the two lines gets me this:

Code:
Warning: fopen(/usr/local/directadmin/plugins/custombuild/logs/1662566733..log): Failed to open stream: No such file or directory in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 22

Fatal error: Uncaught TypeError: fread(): Argument #1 ($stream) must be of type resource, bool given in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw:27
Stack trace:
#0 /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw(27): fread(false, 4096)
#1 {main}
  thrown in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 27

Warning: fopen(/usr/local/directadmin/plugins/custombuild/logs/1662566733..log): Failed to open stream: No such file or directory in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 22

Fatal error: Uncaught TypeError: fread(): Argument #1 ($stream) must be of type resource, bool given in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw:27
Stack trace:
#0 /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw(27): fread(false, 4096)
#1 {main}
  thrown in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 27
Done!
 
Seems like it's a minor glitch protecting everyone from a major error. Swapping the two lines gets me this:

Code:
Warning: fopen(/usr/local/directadmin/plugins/custombuild/logs/1662566733..log): Failed to open stream: No such file or directory in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 22

Fatal error: Uncaught TypeError: fread(): Argument #1 ($stream) must be of type resource, bool given in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw:27
Stack trace:
#0 /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw(27): fread(false, 4096)
#1 {main}
  thrown in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 27

Warning: fopen(/usr/local/directadmin/plugins/custombuild/logs/1662566733..log): Failed to open stream: No such file or directory in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 22

Fatal error: Uncaught TypeError: fread(): Argument #1 ($stream) must be of type resource, bool given in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw:27
Stack trace:
#0 /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw(27): fread(false, 4096)
#1 {main}
  thrown in /usr/local/directadmin/plugins/custombuild/admin/build_software_command.raw on line 27
Done!

I'm sorry for my earlier wrong solution. The right solution is to define $filePath before rule 15.

So you will get the following on rule 14 to 17 :
$timestamp = time();
$filePath = '';
$process->run($filePath);
$filePath = '/usr/local/directadmin/plugins/custombuild/logs/' . $timestamp . '.' . $process->getPid() . '.log';
 
Back
Top