Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: Bobby on April 06, 2020, 12:00:37 PM

Title: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bobby on April 06, 2020, 12:00:37 PM
Hi, i don't know if anyone has reported this issue or not, so i made this topic to describe it:
When i want to install a mod by the package manager, everything seem be Ok (all steps test successfully!). But after i clicked "install now", the forum displayed an error message:
QuoteUnknown column 'sha256_hash' in 'field list'
File: C:\Program Files\Ampps\www\DWVN\Sources\Packages.php
Line: 1219
in Packages.php:
// Credits tag?
$credits_tag = (empty($credits_tag)) ? '' : $smcFunc['json_encode']($credits_tag);
$smcFunc['db_insert']('',
'{db_prefix}log_packages',
array(
'filename' => 'string', 'name' => 'string', 'package_id' => 'string', 'version' => 'string',
'id_member_installed' => 'int', 'member_installed' => 'string', 'time_installed' => 'int',
'install_state' => 'int', 'failed_steps' => 'string', 'themes_installed' => 'string',
'member_removed' => 'int', 'db_changes' => 'string', 'credits' => 'string',
'sha256_hash' => 'string',
),
array(
$package_filename, $package_name, $package_id, $package_version,
$user_info['id'], $user_info['name'], time(),
$is_upgrade ? 2 : 1, $failed_step_insert, $themes_installed,
0, $db_changes, $credits_tag, $context['package_sha256_hash']
),
Line 1219 ===> array('id_install')
);

It happens with all mods so i must be install them manually (so hard you know :))
I'm using SMF2.1 with lastest commit on Github!
What should I do to fix this problem? Thanks for your reading!
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: lurkalot on April 06, 2020, 12:29:31 PM
Yep it does seem to be broken, we had someone mention this issue on our TinyPortal support site a couple of days ago, after he upgraded to latest GitHub version, I've no idea if the issue was reported on GitHub though. 

Edit: I believe he added the column to the database manually and everything was working ok.
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bobby on April 06, 2020, 12:54:46 PM
Thank you for informing me! Actually, i used a trick to add data: installed the mod with SMF 2.0.17 then copied and inserted data to 2.1. Between i'm looking forward to the dev team fixing this problem :)
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: vbgamer45 on April 06, 2020, 02:16:30 PM
There is an upgrade sql statement required with the latest one since new columns were added to log_packages
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bigguy on April 06, 2020, 02:38:19 PM
I went through the upgrade process when I installed the latest from GH and I still got that error. I was the one that posted on TP about this.
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bigguy on April 06, 2020, 04:38:12 PM
A bit more info...

March 31st I updated my forum SMFH to the latest on GH. I ran the installer to upgrade the database and all went well. I then began to install mods. I installed TP and got the above error (OP) Seeing as the error showed after installing the mod there was nothing I could do. All is running fine but in the package manager it says the mod is not installed. So there is no way to uninstall it if I need to. I then installed the arcade, same thing happened. Same error and now it will not uninstall. Both TP and the arcade mods used were the latest versions they have out that install with SMF 2.1
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: shawnb61 on April 06, 2020, 05:38:20 PM
Confirmed. 

Logged issue 6057:  https://github.com/SimpleMachines/SMF2.1/issues/6057
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bigguy on April 06, 2020, 07:37:08 PM
I see that was merged already. I guess I will update the forum again soon, lol. ;)
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bobby on April 07, 2020, 09:24:28 AM
Thank you everyone! The problem has been solved and marked topic solved! :)
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: woolly bugger on April 10, 2020, 02:58:12 PM
so? has this been fixed in the latest github download.

cause i just installed last_commit_0e892c6 and I'm having the same issue..
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: shawnb61 on April 10, 2020, 03:13:54 PM
Yes, it has been fixed.  See your other thread.
Title: Re: Cannot install mod with Database error: 'sha256_hash' in 'field list'
Post by: Bobby on April 13, 2020, 04:34:10 AM
Quote from: shawnb61 on April 10, 2020, 03:13:54 PM
Yes, it has been fixed.  See your other thread.

Hi everyone, i keep getting errors when install any mods:

QuoteType of error: General
2: hash_file(C:\Program Files\Ampps\www\layphat\Packages/Oneall_Social_Login-4.0.0-SMF-2.1): failed to open stream: Permission denied
myforum.com/index.php?action=admin;area=packages;sa=install2;package=Oneall_Social_Login-4.0.0-SMF-2.1;pid=0
C:/Program Files/Ampps/www/layphat/Sources/Packages.php (Line 897)
-------------------------------------------

Type of error: General
2: hash_file(C:\Program Files\Ampps\www\layphat\Packages/Oneall_Social_Login-4.0.0-SMF-2.1): failed to open stream: Permission denied
myforum.com/index.php?action=admin;area=packages;sa=install;package=Oneall_Social_Login-4.0.0-SMF-2.1
C:/Program Files/Ampps/www/layphat/Sources/Subs-Package.php (Line 3154)

I'm using Ampps on Windows 10, PHP 7.3, MySQL 8.0.18, Apache 2.4.41.
Can you please check this issue? Thank you!