Keyword

Latest K2 update CRASH on Joomla 3 with PHP8 (from v2.10.3...)

  • Michael
  • Michael's Avatar Topic Author
  • Offline
  • New Member
More
1 year 3 months ago #180692 by Michael
This is weird!  I tested the update on our DEV server ( clone of our live server) and it updated 100% fine to 2.11
Joomla 3.10.11 on PHP 8.0.27

BUT, when I then went to update on our LIVE server, I got this error:

An error has occurred.
-1 Copy file failed

I can't find any trace of this in PHP error logs, or Joomla  
Any hints about where i might be able to see what files are failing and where permissions are out. ???
(Actually they should not be any different than the permissions on our DEV server, where the update worked...)

after the failed update, the K2 blogs all work fine in front end and back, unless i click on a link to the category.. then I get this:

 Error: 1176 - Key 'idx_item' doesn't exist in table 'i'

ouch!!

Please Log in or Create an account to join the conversation.

More
1 year 3 months ago #180695 by JoomlaWorks
Re-install K2 so it creates the needed index key.

To see a full log of what's wrong, set error reporting to maximum and ensure Joomla debugging is also enabled. I'm not sure if this was always the case, but with PHP 8 it seems to be.

Also switch to PHP 8.1 if you can and use the PDO MySQL database driver in Global Config. This is how we run the K2 demo site.

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.

  • Michael
  • Michael's Avatar Topic Author
  • Offline
  • New Member
More
1 year 2 months ago #180755 by Michael
I'm not sure we are ready to switch to PHP8.1 yet!

I just updated our DEV server with a refresh from our Live server, and now it crashes updating on DEV :(
(from 2.10.3 to latest offered 2.11.20230112)

"An error has occurred. -1 Copy file failed".

Downloaded "reinstall" and get the same error

"An error has occurred. -1 Copy file failed".

Permissions issue?? I have no problem updating any other Joomla extension, ( and I used to be able to update K2 just fine) Not sure exactly what needs to be re-set

this is what the debugger shows

RuntimeException [500]
Copy file failed
.../libraries/src/Filesystem/:160
155 }
156 else
157 {
158 if (!@copy($sfid, $dfid))
159 {
160 throw new \RuntimeException('Copy file failed', -1);
161 }
162 }
163 break;
164 }
165 }

bottom of stack:

Joomla\CMS\Application\CMSApplication->execute()
.../administrator/:51
46
47 // Instantiate the application.
48 $app = JFactory::getApplication('administrator');
49
50 // Execute the application.
51 $app->execute();

top of stack:

Joomla\CMS\Filesystem\Folder::copy()
.../libraries/src/Filesystem/:134
129 switch (filetype($sfid))
130 {
131 case 'dir':
132 if ($file != '.' && $file != '..')
133 {
134 $ret = self::copy($sfid, $dfid, null, $force, $useStreams);
135
136 if ($ret !== true)
137 {
138 return $ret;
139 }
Arguments
src
string(128) "/var/www/html/sitename/html/tmp/install_63e7fb4ae3e3d/k2-master/media/k2/assets/vendors/verot/"
dest
string(92) "/var/www/html/sitename/html/media/k2/assets/vendors/verot/"
path
NULL
force
bool TRUE
useStreams
bool FALSE

Please Log in or Create an account to join the conversation.

  • Michael
  • Michael's Avatar Topic Author
  • Offline
  • New Member
More
1 year 2 months ago - 1 year 2 months ago #180756 by Michael
update: i found the problem, I HAD FORGOTTEN that back in November when we changed to PHP8 I had edited the ancient php file in
/var/www/html/sitename/html/media/k2/assets/vendors/verot/class.upload.php/src to fix a PHP8 error... and apache lost ownership ( oops)

FIXED with corrected apache:apache permissions - Update went through just fine.

All working fine now, sorry to bother you!
Last edit: 1 year 2 months ago by Michael.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum