Hashtopolis Forum

Full Version: Server Update woes
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

Longtime user, big fan of your work. Thank you for everything you've done.

Hashtopolis: 0.5.1
PHP: 7.0.33
MariaDB: 10.1.37


I'm attempting to upgrade the server to latest, and come across an odd hurdle.

I backed up db.php, Encryption.class.php and files/
Trashed it,
Put https://archive.hashtopolis.org/server/all/0.10.1.zip files in,
replace db.php, Encryption.class.php and files/
jump into install/updates/

When I attempt "php -f update_v0.5.x_v0.6.0.php", it has a total hissyfit:
PHP Parse error:  syntax error, unexpected '=' in /var/www/html/install/updates/update_v0.5.x_v0.6.0.php on line 13

That line simply being "Factory = new Factory();"

Literally the first line after the includes.


Help would be hugely appreciated.
That's a pretty old version you got there Smile

Could you try if it works if you just remove that faulty line? It might be a leftover from an older update procedure file which is not needed anymore as the factory was changed to a singleton pattern.
Sure thing, after commenting it out I got this:

Code:
Apply updates...
Check agent binaries... PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updateTrack' in 'field list' in /var/www/html/dba/AbstractModelFactory.class.php:569
Stack trace:
#0 /var/www/html/dba/AbstractModelFactory.class.php(569): PDOStatement->execute(Array)
#1 /var/www/html/dba/models/AgentBinaryFactory.class.php(54): DBA\AbstractModelFactory->filter(Array, true)
#2 /var/www/html/inc/Util.class.php(194): DBA\AgentBinaryFactory->filter(Array, true)
#3 /var/www/html/install/updates/update_v0.5.x_v0.6.0.php(18): Util::checkAgentVersion('python', '0.1.4')
#4 {main}
 thrown in /var/www/html/dba/AbstractModelFactory.class.php on line 569



Progress is progress. Tongue

I may rollback this VM and retry (with the line 13 factory commented out of course) to ensure I didn't do something stupid.

Mind you if the above can't find a column in the DB, either something's out of sync with the update vs the DB, or the dba code is too far ahead of the schema to work properly anymore.


Any hints? Tongue
The issue is that the update script is that old, that some components which the update script depends on were changed and don't work on the really old DB anymore.

But I think you should be fine if you also just remove the lines where the agent update is checked (because that's the part where it uses some changed function). So just remove the following lines:

Code:
echo "Check agent binaries... ";
Util::checkAgentVersion("python", "0.1.4");
Util::checkAgentVersion("csharp", "0.52.2");
echo "\n";
Side note (this is on a completely different test installation)
I also just noticed in the new one 0.10.1, in /tasks.php it's not showing the TOTAL hashes under the agent column (ie: 2 @483.91 kH/s ). That figure is definitely not the total of the 2 agents.
Going into the task and reading the graph or speed however shows the correct amount. It seems the figure in /tasks.php is the speed of the last checked in agent?
Yep that worked, up to update_v0.8.0_v0.9.0.php .

Code:
NOTICE: After this update the Peppers for Encryption.class.php and CSRF.class.php are stored in the new config file. So if you didn't merge them you would have to put the old pepper values into inc/conf.php to make the log in working again. Read more on this on the specific release information.
Apply updates...
Moving db config... OK
Check agent binaries... PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'updateTrack' in 'field list' in /var/www/html/dba/AbstractModelFactory.class.php:569
Stack trace:
#0 /var/www/html/dba/AbstractModelFactory.class.php(569): PDOStatement->execute(Array)
#1 /var/www/html/dba/models/AgentBinaryFactory.class.php(54): DBA\AbstractModelFactory->filter(Array, true)
#2 /var/www/html/install/updates/update_v0.8.0_v0.9.0.php(31): DBA\AgentBinaryFactory->filter(Array, true)
#3 {main}
 thrown in /var/www/html/dba/AbstractModelFactory.class.php on line 569


It's just moved/changed the DB conf, so on the next run of this the DB is unusable to update.  Tongue
I'll rollback the snapshot and start over.


So, for update_v0.8.0_v0.9.0 the errored line is thrown at 31, which is:




Code:
  $binary = Factory::getAgentBinaryFactory()->filter([Factory::FILTER => $qF], true);
  if ($binary != null) {
    if (Util::versionComparison($binary->getVersion(), "0.3.0") == 1) {
      echo "update python version... ";
      $binary->setVersion("0.3.0");
      Factory::getAgentBinaryFactory()->update($binary);
      echo "OK";
    }
  }



How hosed am I?