ElkArte Community

Project Support => Support => Topic started by: radu81 on June 25, 2018, 08:31:38 pm

Title: Update manually from 1.1.3 to 1.1.4
Post by: radu81 on June 25, 2018, 08:31:38 pm
I usually do a full backup before any update, but in these days I'm a little busy, there is a week since I don't turn on my PC :(
Initially I wanted to do the update after next week, but since the 1.1.4 corrects a security bug I just upload the patch and hit the update button. There were no errors displayed during install, and once hit the install button I got an error (sorry but I did not take notice, it was something related to Zend Opcache and there was a back button). I pressed the back button and the 1.1.4 patch seems installed in package manager and in footer I see 1.1.4 version. After a quick test I noticed that the patch install did not went fine, unread replies were not working and the file sources\subs\Unread.class.php was not edited after the update. I also have no option in ACP for the new privacy policy.

At this point I am wondering how can I correct all this? Downloading and overwriting the files that contains edits from 1.1.4 will be enough, or there is something else I need to do ? Should I do a large update?

Thank you in advance
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on June 26, 2018, 02:18:07 am
Try uninstall the package and see what errors you get (and what modifications are not marked as errors).
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: radu81 on June 26, 2018, 02:34:54 pm
I'll try later, thanks for the tip, this time I will do a full backup. The funny part is I always did a full backup before an update and I never used it, first time without a backup and now I need it. >:(

I'm somehow unfortunate in these days, yesterday the forum update + my Nexus 5x died in my hands after an app crash an decided to not turn on anymore, today at work they changed an ssd drive, they said they did a full image of the old disk, but nothing is working as before. :(
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on June 26, 2018, 05:25:08 pm
Great beginning of the week! xD
BTW I meant to just test the uninstall to see what is wrong and from there try to understand what happened, no need to actually uninstall. ;)
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: radu81 on June 26, 2018, 06:53:50 pm
 Yep  :D and the warranty of my phone expired on 8 June :)

If I try to uninstall the patch I see only one error for the file Unread.class.php and that's strange, I copied that file from 1.1.4 otherwise unread replies won't work. 
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: ahrasis on June 26, 2018, 07:28:17 pm
I think you can simply extract 1.1.4 install file to fix it or the latest backup from your packages/backups folder, if you want to restore.
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on June 27, 2018, 02:33:48 am
hmm...
That is pretty odd.

My first thought was that only code was not executed due to the opcache error. But that wouldn't explain the missing menu (actually, that could be explained by a high level of caching, maybe).
So I was wondering what could be the errors you got, but apparently you have none.
So now I'm a little lost. xD

Would you mind zipping the files and upload them somewhere and send me the place so that I can take a look?
I'm pretty curious now.
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: radu81 on June 29, 2018, 03:55:15 am
Quote from: ahrasis – I think you can simply extract 1.1.4 install file to fix it or the latest backup from your packages/backups folder, if you want to restore.
I cannot use it, I disabled that function into my forum :(

Quote from: emanuele – Would you mind zipping the files and upload them somewhere and send me the place so that I can take a look?
I'm pretty curious now.
Sorry for the delay, but I didn't had time to use my pc in these days, I send you a PM, thank you.
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on June 29, 2018, 01:32:59 pm
No problem! ;)
I've seen the file, I don't think I'll be able to do much during the weekend, but I'll give it a try as soon as I can. ;)
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: radu81 on June 29, 2018, 04:15:39 pm
There is no hurry, for a week I will not have access to a pc  ;)
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on July 09, 2018, 05:44:38 pm
I did some "random" checks and from what I can see, the patch was applied only to some of the files in the root of the forum (index.php, bootstrap.php, the email stuff), while it was not applied to SSI and pretty much any file in sources or themes (TBH I'm not 100% sure because I did a diff and checked only the files that appeared different that is a way to say "most of the file were not patched, there may be some that have been patched).
I'm still somehow positive that uninstall and re-install should either fix the issue or in the worst case end up in the same situation as the current one.
Maybe, before doing it, check the files and directories permissions.
Another thing, before actually uninstall the patch, when you do the uninstall test, track down the files on which there is NO error reported and post them here. I'd like to see if there is any apart the two I spotted that was patched correctly.
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: radu81 on July 09, 2018, 07:21:01 pm
Thanks for watching into this ;)
I tried to uninstall the patch, I only get an error with the file Unread.class.php and if I proceed with uninstall I get the same error as I got during the install of patch: Zend OPcache API is restricted by "restrict_api" configuration directive and the patch is not uninstalled.

From a quick google search that error seems related to PHP 7.2, so I switched to PHP 5.6 and I was able to uninstall and then install correctly the 1.1.4 patch. Problem solved ;)

edit
in elkarte error log I see:
Code: [Select]
    Tipo di errore: Generale
    Warning: Zend OPcache API is restricted by "restrict_api" configuration directive

    /index.php?action=admin;area=packages;sa=install2;package=ElkArte_v1-1-4_patch.zip;pid=0

    File: /public/packages/temp/code.php
    Riga: 74
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on July 10, 2018, 07:24:17 am
hmm... interesting, so apparently some hosts disable this function fearing abuses. But of course this breaks the appropriate uses and creates some issues in this specific case and, unless I'm flying too high, also to almost any other patch we are going to release from now on (and likely to mods as well).
@Spuds what do you think?
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: Spuds on July 11, 2018, 07:24:03 am
Grrrr .... I thought I had adjusted for that condition in this commit :: https://github.com/elkarte/Elkarte/commit/91bf175d0b7ee1db77bf532b170a7f17b9d7d4fd    So it would seem that needs to have further adjustments.  The check is as follows.

Code: [Select]
if (extension_loaded('Zend OPcache') && ini_get('opcache.enable') && stripos(BOARDDIR, ini_get('opcache.restrict_api')) !== 0)

Which should check that the extension is loaded, is enabled, and the path is not restricted.   What is the output of ini_get('opcache.restrict_api'); ... seems like that is where the check is failing.





Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on July 11, 2018, 02:42:02 pm
But even if we know the "clean cache" api function is not available, we would still have the problem that the cache is enabled and not flushed, so we'd just come back to the same as not having the flush cache function called... :-\
No?
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: Spuds on July 11, 2018, 04:30:13 pm
I think there were two issues ...

One was that code.php was running before the new files were written to their final locations, that needed package_flush_cache

The second was that after updating a file, the update may not be reflected if the opcache update check is set to aggressive.  For that one if we can't flush the opcache, well I'm not sure what to do.
Title: Re: Update manually from 1.1.3 to 1.1.4
Post by: emanuele on July 11, 2018, 04:54:38 pm
Oh yes, right they were 2... dammit.