VaultWiki

VaultWiki [Paid] 4.1.7 Patch Level 1

No permission to buy ($15.00)
No, extras like branding removal affect the overall subscription price, so you would have an increased monthly price for as long as you keep branding removal turned on. Also, the terms for some extras are slightly different. Even though you are allowed to keep using the software after your subscription is over, you must keep your subscription current in order to maintain the branding removal.
 
No, extras like branding removal affect the overall subscription price, so you would have an increased monthly price for as long as you keep branding removal turned on. Also, the terms for some extras are slightly different. Even though you are allowed to keep using the software after your subscription is over, you must keep your subscription current in order to maintain the branding removal.
I bought your addon and failed to install addon caused error:
Code:
[root@root httpdocs]$ php cmd.php xf-addon:install vw/vw
Please confirm that you want to install the following add-on: (VaultWiki 4.1.9) (y/n)y

In Process.php line 144:

  Symfony\Component\Process\Process::__construct(): Argument #1 ($command) must be of type array, string g
  iven, called in /var/www/vhosts/domain.com/httpdocs/src/addons/vw/vw/Setup/ProcessHelper/ProcessHelper
  Base.php on line 41


In Process.php line 144:

  Symfony\Component\Process\Process::__construct(): Argument #1 ($command) must be of type array, string g
  iven, called in /var/www/vhosts/domain.com/httpdocs/src/addons/vw/vw/Setup/ProcessHelper/ProcessHelper
  Base.php on line 41


xf:addon-install [-f|--force] [--] <id>

Code:
Server error log
[LIST]
[*]XF\Mvc\Reply\Exception: Batch install error: 
[*]src/addons/vw/vw/Setup.php:752
[*]Generated by: Yenxji
[*]Jun 12, 2025 at 17:08
[/LIST]
[HEADING=2]Stack trace[/HEADING]
#0 src/addons/vw/vw/Setup.php(420): vw\vw\Setup->vwHandleBrowserInteractions(Object(vw\vw\Setup\View), Array)
#1 src/addons/vw/vw/Setup.php(378): vw\vw\Setup->vwHandleInteractions(Object(vw\vw\Setup\View), Array)
#2 src/addons/vw/vw/Setup.php(362): vw\vw\Setup->vwHandleException(Object(vw\vw\Setup\Exception), Object(vw\vw\Setup\Caller\Install), Array)
#3 src/addons/vw/vw/Setup.php(268): vw\vw\Setup->vwRunStep('install', Object(vw_Install_Full_Steps_Controller_XF2), Array, 10)
#4 src/XF/Job/AddOnInstallBatch.php(299): vw\vw\Setup->install(Array)
#5 src/XF/Job/AddOnInstallBatch.php(95): XF\Job\AddOnInstallBatch->stepAction(Object(XF\Timer))
#6 src/XF/Job/Manager.php(275): XF\Job\AddOnInstallBatch->run(8)
#7 src/XF/Job/Manager.php(205): XF\Job\Manager->runJobInternal(Array, 8)
#8 src/XF/Job/Manager.php(121): XF\Job\Manager->runJobEntry(Array, 8)
#9 src/XF/Admin/Controller/ToolsController.php(146): XF\Job\Manager->runByIds(Array, 8)
#10 src/XF/Mvc/Dispatcher.php(362): XF\Admin\Controller\ToolsController->actionRunJob(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(264): XF\Mvc\Dispatcher->dispatchClass('XF:Tools', 'RunJob', Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\Tools), NULL)
#12 src/XF/Mvc/Dispatcher.php(121): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserMentionsImprovements\XF\Admin\Controller\Tools), NULL)
#13 src/XF/Mvc/Dispatcher.php(63): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2826): XF\Mvc\Dispatcher->run()
#15 src/XF.php(806): XF\App->run()
#16 admin.php(15): XF::runApp('XF\\Admin\\App')
#17 {main}
[HEADING=2]Request state[/HEADING]
array(4) {
  ["url"] => string(24) "/admin.php?tools/run-job"
  ["referrer"] => string(44) "https://domain.com/admin.php?tools/run-job"
  ["_GET"] => array(1) {
    ["tools/run-job"] => string(0) ""
  }
  ["_POST"] => array(3) {
    ["_xfRedirect"] => string(80) "https://domain.com/admin.php?add-ons/install-from-archive-complete&batch_id=38"
    ["_xfToken"] => string(8) "********"
    ["only_ids"] => string(6) "665757"
  }
}
 
It looks like installing the add-on directly from the archive using CLI is not working and we will need to do some investigation.

We typically do not recommend this type of installation process for VaultWiki anyway.
Please follow the recommended installation instructions: https://www.vaultwiki.org/pages/Help/VaultWiki-4-Manual/VW4:Running-the-VaultWiki-Install-Script
Here is what I started from first. I went to AdminCP to install the addon, but it failed to install. Then I decided to use the second CLI to install the add-on again, and still same failed
 
Batch install error: [*]src/addons/vw/vw/Setup.php:752
You received the error message above because VaultWiki is having trouble being installed using XenForo's batch installer. It looks like the batch installer has changed in more recent XenForo versions, and VaultWiki's installer needs to be updated for it to work again.

In the mean time, VaultWiki asks you questions during install, which need to be answered. Currently, XenForo's batch installer sees these questions as errors and prevents it from moving forward. Line 752 is the installer asking a question to the admin. Please use the recommended installation process in our manual which involves uploading the add-on manually and using the Install button once the add-on appears in your add-ons list. Then you will see the installer's question and be able to respond, rather than an error message.
 
You received the error message above because VaultWiki is having trouble being installed using XenForo's batch installer. It looks like the batch installer has changed in more recent XenForo versions, and VaultWiki's installer needs to be updated for it to work again.

In the mean time, VaultWiki asks you questions during install, which need to be answered. Currently, XenForo's batch installer sees these questions as errors and prevents it from moving forward. Line 752 is the installer asking a question to the admin. Please use the recommended installation process in our manual which involves uploading the add-on manually and using the Install button once the add-on appears in your add-ons list. Then you will see the installer's question and be able to respond, rather than an error message.
Your addon installation still has an issue on XF 2.3.6

I have fixed your addon of installation issue, so here

src\addons\vw\vw\Setup\ProcessHelper\ProcessHelperBase.php
Diff:
--- ProcessHelperBase.php (original)
+++ ProcessHelperBase.php (fixed)
@@ -30,6 +30,11 @@
 
                 if (\vw_Compat::is('2.3.0 Alpha 0'))
                 {
+                    // For XF 2.3+, convert command string to array format
+                    if (is_string($script)) {
+                        // Split the command string into an array
+                        // Handle quoted arguments properly
+                        $script = $this->parseCommandString($script);
+                    }
                     $newProcess = new Process($script, $cwd, $env, $input, $timeout);
                 }
                 else
@@ -50,4 +55,54 @@
 
         return $this->vwInput;
     }
+
+    /**
+     * Parse a command string into an array of arguments
+     * Handles quoted arguments properly
+     */
+    private function parseCommandString($command)
+    {
+        if (is_array($command)) {
+            return $command;
+        }
+
+        // Use shell argument parsing if available
+        if (function_exists('str_getcsv')) {
+            // Use str_getcsv to parse shell-like arguments
+            return str_getcsv($command, ' ', '"');
+        }
+
+        // Fallback: simple space split (may not handle quoted args perfectly)
+        $args = [];
+        $current = '';
+        $inQuotes = false;
+        $quoteChar = null;
+        $len = strlen($command);
+
+        for ($i = 0; $i < $len; $i++) {
+            $char = $command[$i];
+
+            if (!$inQuotes && ($char === '"' || $char === "'")) {
+                $inQuotes = true;
+                $quoteChar = $char;
+            } elseif ($inQuotes && $char === $quoteChar) {
+                $inQuotes = false;
+                $quoteChar = null;
+            } elseif (!$inQuotes && $char === ' ') {
+                if ($current !== '') {
+                    $args[] = $current;
+                    $current = '';
+                }
+            } else {
+                $current .= $char;
+            }
+        }
+
+        if ($current !== '') {
+            $args[] = $current;
+        }
+
+        return $args;
+    }
 }

src\addons\vw\vw\Setup\ProcessHelper\ProcessHelper23.php
Diff:
--- ProcessHelper23.php (original)
+++ ProcessHelper23.php (fixed)
@@ -13,5 +13,5 @@
 
 class ProcessHelper23 extends ProcessHelperBase
 {
-    public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null) : \Symfony\Component\Process\Process
+    public function mustRun(OutputInterface $output, $cmd, $error = null, callable $callback = null): \Symfony\Component\Process\Process
     {
         return $this->vwMustRun($output, $cmd, $error, $callback);
     }

ProcessHelperBase.php - Diff: Shows the fix changes made to fix the XF 2.3.6 compatibility issue
ProcessHelper23.php - Diff: Shows the minor formatting fix (space before colon in return type) ( : )

The error addon of install is completely gone and works perfectly without issue
 
1749828957006.webp

By the way, this is very important for a safe user to prevent issues in the future.

I’ve updated the Setup.php file in your addon to prevent issues caused by users who don’t read the FAQ manual without the knowledge that may cause the database to become corrupt if they proceed without a backup. Many users may have to report your addon that caused problems. You should prevent CLI installations for now until you identify and fix the underlying CLI issue, then you can safely re-enable CLI support, allowing even less experienced users to install the addon without causing problems.

Diff:
--- Setup.php.original
+++ Setup.php.modified
@@ -1,7 +1,7 @@
     public function vwIsCli()
     {
-        return is_a(\XF::app(), '\XF\Cli\App');
+        // Always return false to completely disable CLI functionality
+        return false;
     }
 
     public function checkRequirements(&$errors = [], &$warnings = [])
     {
+        // Block CLI operations completely
+        if (is_a(\XF::app(), '\XF\Cli\App'))
+        {
+            $errors[] = 'VaultWiki cannot be installed, upgraded, or uninstalled via CLI. Please use the AdminCP interface instead. Go to Admin CP > Add-ons to manage VaultWiki.';
+            return;
+        }
+
+        // Ensure error handler is still active for web interface
+        set_error_handler(function($severity, $message, $file, $line, $context = null) {
+            // Handle fread() errors specifically
+            if (strpos($message, 'fread()') !== false && strpos($message, 'must be greater than 0') !== false)
+            {
+                return true; // Suppress the error
+            }
+           
+            // Handle other VaultWiki compatibility issues
+            if (strpos($message, 'Argument #2') !== false && strpos($file, 'vw') !== false)
+            {
+                return true; // Suppress VaultWiki-related argument errors
+            }
+           
+            // Let other errors pass through normally
+            return false;
+        }, E_ALL);
+
         $base = 0;
 
         if (!defined('VW_IS_LITE') OR VW_IS_LITE !== true)
@@ -86,36 +110,6 @@
         {
             $errors[] = $this->vwView('install')->get_phrase('minimum_requirements_zlib');
         }
-
-        if ($this->vwIsCli())
-        {
-            $bt = debug_backtrace();
-            array_shift($bt);
-
-            $addon = array_shift($bt);
-
-            if (isset($addon['object']) AND $addon['object'] === $this->addOn)
-            {
-                $command = array_shift($bt);
-
-                if (
-                    isset($command['object']) AND
-                    (
-                        is_a($command['object'], '\XF\Cli\Command\AddOnInstall') OR
-                        is_a($command['object'], '\XF\Cli\Command\AddOnUpgrade')
-                    )
-                )
-                {
-                    if (\vw_Compat::is('2.3.0 Alpha 0'))
-                    {
-                        $help = new Setup\ProcessHelper\ProcessHelper23();
-                    }
-                    else if (\vw_Compat::is('2.2.0 Beta 1'))
-                    {
-                        $help = new Setup\ProcessHelper\ProcessHelper22();
-                    }
-                    else
-                    {
-                        $help = new Setup\ProcessHelper\ProcessHelper2();
-                    }
-
-                    $application = $command['object']->getApplication();
-                    $helperSet = $application->getHelperSet();
-                    $helperSet->set($help);
-                }
-            }
-            unset($bt);
-        }
     }
 
     public function install(array $stepParams = [])
     {
+        // Block CLI installation completely
+        if (is_a(\XF::app(), '\XF\Cli\App'))
+        {
+            throw new \Exception('VaultWiki cannot be installed via CLI. Please use the AdminCP interface instead. Go to Admin CP > Add-ons > Install from archive or Install from directory.');
+        }
+
         static $running = false;
 
+        // Set up error handler for web interface
+        set_error_handler(function($severity, $message, $file, $line, $context = null) {
+            if (strpos($message, 'fread()') !== false && strpos($message, 'must be greater than 0') !== false)
+            {
+                return true;
+            }
+            if (strpos($message, 'Argument #2') !== false && strpos($file, 'vw') !== false)
+            {
+                return true;
+            }
+            return false;
+        }, E_ALL);
+
         if (!defined('VW_INSTALL'))
         {
             define('VW_INSTALL', 1);
@@ -200,6 +194,9 @@
             break;
         }
 
+        // Restore original error handler
+        restore_error_handler();
+
         return $result;
     }
 
     public function upgrade(array $stepParams = [])
     {
+        // Block CLI upgrade completely
+        if (is_a(\XF::app(), '\XF\Cli\App'))
+        {
+            throw new \Exception('VaultWiki cannot be upgraded via CLI. Please use the AdminCP interface instead. Go to Admin CP > Add-ons > Upgrade.');
+        }
+
         if (!defined('VW_INSTALL'))
         {
             define('VW_INSTALL', 2);
 
Last edited:
I'm confused. I thought you confirmed the CLI installation completed successfully after you made the previous change you suggested.

The remaining issue was the batch installer when installing directly from the archive via a browser. This would not cause database damage, it just prevents you from moving forward because the installer is requesting a user interaction.

If you're referring to the warning in the manual only, it specifically refers to XenForo versions under 2.0.11, because there was a bug in XenForo at that time. XenForo fixed the issue in 2.0.11, and the CLI installer worked fine after that. We actually don't support XenForo (2) versions under 2.1.x anymore or offer a compatible version for download, so no one should be trying to install onto those XenForo versions.
 
It took me a bit to figure out what errors you're trying to suppress, since they aren't any that you reported.

For the fread error, it seems like this occurs when trying to opening the install log the next time you open the installer, if you previously started an installation that created the log but didn't write anything into it yet. This is a rare situation but the easiest temporary solution would be to delete the log directory at internal_data/vw_logs/install/, rather than write a custom error handler.

For the "Argument #2" error in a "vw" file, this is so vague I have no idea what it's referring to.
 
It took me a bit to figure out what errors you're trying to suppress, since they aren't any that you reported.

For the fread error, it seems like this occurs when trying to opening the install log the next time you open the installer, if you previously started an installation that created the log but didn't write anything into it yet. This is a rare situation but the easiest temporary solution would be to delete the log directory at internal_data/vw_logs/install/, rather than write a custom error handler.

For the "Argument #2" error in a "vw" file, this is so vague I have no idea what it's referring to.
I have encountered and fixed an installation error in VaultWiki while using XenForo 2.3.6. Because it is an issue from Symfony’s new requirement that Process::__construct() must receive an array instead of a string (as of XF 2.3+). VaultWiki's installer still passes a command string, caused by:
Code:
Symfony\Component\Process\Process::__construct(): Argument #1 ($command) must be of type array, string given


The issue came from the site add-on where I downloaded the file. The file add-ons are corrupted. You need to replace and reupload the file to your website for access download, and make sure to prevent this issue from happening again. Please reupload it if possible.
 
Yes, we had discussed Process::__construct() earlier, but I still don't know why you put this in your custom error handler:
Code:
if (strpos($message, 'Argument #2') !== false && strpos($file, 'vw') !== false)
The Process::__construct() error says:
Code:
Argument #1 ($command) must be of type array
so it does not match your error handler. So you must be trying to suppress a different error that you did not discuss.

You mentioned you had archive corruption of the downloaded ZIP, or that one or more files in the ZIP was corrupted. You should connect with support on the web site where you got the ZIP, and explain what was corrupted in more detail. I just downloaded a copy and it seems to unpack okay. To prevent it from happening again, they will need to know exactly what you experienced.

Since it may have led to archive corruption, my understanding is that the main support site was under a DDOS attack from about May 25 to June 10 of this year. This resulted in slow response times and randomly dropped connections. If you downloaded the ZIP during this period, it is theoretically possible that the archive was not completely downloaded and the file could be corrupt. However, if this was the case I think you wouldn't be able to open the archive or upload any of the files inside it.

I know you were installing and not upgrading, but I'll add this in case it helps someone else: Sometimes people have thought the archive was corrupted when they upload the files in order to upgrade (usually, a class is unexpectedly missing, or a file has unexpectedly ended). This is usually from visitors trying to run code while the files are still uploading, which can result in the partially uploaded files becoming cached. Sometimes you may need to clear PHP's opcode cache to resolve this. If using Zend Cache, this is done by restarting the PHP server process. XenForo's batch installer doesn't automatically reset the opcache until after all files are uploaded, so if the upload takes multiple refreshes, even the batch installer can encounter this problem. This is why we recommend disabling the add-on before uploading a new ZIP, and not re-enabling it until the ZIP is fully uploaded. Information like this is also why it's a good idea to read the install/upgrade docs and follow the recommended steps.
 
Last edited:
Back
Top Bottom