Advertisement:

Author Topic: upgrade 2.0.15 --> 2.0.16 fail  (Read 2239 times)

Offline AlanDewey

  • Semi-Newbie
  • *
  • Posts: 67
    • CCS Forum
upgrade 2.0.15 --> 2.0.16 fail
« on: December 28, 2019, 09:48:58 AM »
bit of a noooob here....


SMF 2.0.15
PHP 7.1.26

get this failure notice

Code: [Select]
* 37. Execute Modification .\Sources/Post.php Test successful
* 38. Execute Modification .\Sources/Profile-Modify.php Test failed
1. Replace .\Sources/Profile-Modify.php Test successful
2. Add After .\Sources/Profile-Modify.php Test successful
3. Replace .\Sources/Profile-Modify.php Test successful
4. Add After .\Sources/Profile-Modify.php Test successful
5. Add Before .\Sources/Profile-Modify.php Test successful
6. Replace .\Sources/Profile-Modify.php Test failed
* 39. Execute Modification .\Sources/Profile.php Test successful


I discovered that    profile-modify.php~      was read-only.   I fixed that, now all permissions,  ran install again, but get identical error.

I thank everyone in advance for your generous assistance.
Glorified Janitor

Offline m4z

  • Localizer
  • Sr. Member
  • *
  • Posts: 914
  • /mɛs/
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #1 on: December 28, 2019, 10:41:36 AM »
I discovered that    profile-modify.php~      was read-only.   I fixed that, now all permissions,  ran install again, but get identical error.

Files ending with a tilde are just backup files, I assume this doesn't cause your problem.
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline m4z

  • Localizer
  • Sr. Member
  • *
  • Posts: 914
  • /mɛs/
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #2 on: December 28, 2019, 10:44:43 AM »
get this failure notice

Code: [Select]
* 37. Execute Modification .\Sources/Post.php Test successful
* 38. Execute Modification .\Sources/Profile-Modify.php Test failed
1. Replace .\Sources/Profile-Modify.php Test successful
2. Add After .\Sources/Profile-Modify.php Test successful
3. Replace .\Sources/Profile-Modify.php Test successful
4. Add After .\Sources/Profile-Modify.php Test successful
5. Add Before .\Sources/Profile-Modify.php Test successful
6. Replace .\Sources/Profile-Modify.php Test failed
* 39. Execute Modification .\Sources/Profile.php Test successful

Are you using any mod packages?
"Faith is what you have in things that don't exist."
--Homer Simpson

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 168
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #3 on: December 28, 2019, 11:04:03 AM »
Hi there,

I am less of a newbie, but am getting the same error - everything tests OK, except this one file.

Its the last bit - the replace.

Code: [Select]
$sizes = @getimagesize($_FILES['attachment']['tmp_name']);

// No size, then it's probably not a valid pic.
// No size, then it's probably not a valid pic.
$mime_valid = check_mime_type($_FILES['attachment']['tmp_name'], 'image/', true);
$sizes = empty($mime_valid) ? false : @getimagesize($_FILES['attachment']['tmp_name']);

// No size, then it's probably not a valid pic.

I've attached my copy of it in the hope someone can help me.

I've got lots of mods, but I'd suspect "Automatic Attachment Rotation (and Resize)" could be the culprit... or possibly "Image Processing Memory Limit" ?

Offline AlanDewey

  • Semi-Newbie
  • *
  • Posts: 67
    • CCS Forum
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #4 on: December 28, 2019, 11:10:08 AM »
Mods:  yes       SMF ads

I had suspected that it failed to make the 'new' backup file  Profile-Modify.php~   because the existing one was read-only.  So I thought it 'passed' modifying Profile-Modify.php  but could not make the backup when it got to step 6   Replace.   

But now I see that line 1 and 3 "replace" were successful.  Did not notice that earlier.   (remember I am noob.)

I checked the timestamps on the files and none have today's date.  I do not understand the process where SMF "tests" these things without actually doing them.

Attached my profile-modify.php from 2017.     

I see that in mine, and in QE2,  profile-modify.php it states version 2.0.14  -   relevant?
Glorified Janitor

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 168
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #5 on: December 28, 2019, 11:18:40 AM »
I do not understand the process where SMF "tests" these things without actually doing them.


It does a "find" for an exact string, so it can find the right bit of code to change.  This will "fail" if it can't find the exact string.

This can happen because a mod has changed it.  I've often had to go in and put the code back to how it expects it to be, before I can do what I'm trying to do.

Its not just upgrades - installing (or uninstalling) a mod can hit the same snag.

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,918
    • sbulen on GitHub
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #6 on: December 28, 2019, 02:06:00 PM »
Let's start with QE2... 

~Line 2688, your file has:
Code: [Select]
$sizes = @getimagesize($_FILES['attachment']['tmp_name']);

// No size, then it's probably not a valid pic.
if ($sizes === false)

Vanilla 2.0.15 has an odd quirk where a comment is repeated:
Code: [Select]
$sizes = @getimagesize($_FILES['attachment']['tmp_name']);

// No size, then it's probably not a valid pic.
// No size, then it's probably not a valid pic.
if ($sizes === false)

You want to match the 2.0.15 code for the search/replace to work.  I would make your version match 2.0.15 by repeating the comment & try again.

Looks like that duplicate comment bugged someone so they deleted it...  The 2.0.16 patch gets rid of it...
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline t-geronimo

  • Newbie
  • *
  • Posts: 6
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #7 on: December 29, 2019, 05:06:23 AM »
Many thanks, shawnb61! That fixed my first issue.

Sadly I have another one, "./Sources/QueryString.php" also failed:

Code: [Select]
[search]
$buffer = preg_replace_callback('~"' . preg_quote($scripturl, '/') . '\?((?:board|topic)=[^#"]+?)(#[^"]*?)?"~', 'pathinfo_insert__preg_callback', $buffer);
}

Code: [Select]
[replace]
// Be nice and try to inject session tokens into login forms since many older themes don't.
if ($user_info['is_guest'])
$buffer = preg_replace_callback(
'~(<form[^<]+action=login2(.+))</form>~iUs' . (!empty($context['utf8']) ? 'u' : ''),
function ($m) use ($context)
{
$repl = '';
if (strpos($m[0], $context['session_var']) === false)
$repl .= '<input type="hidden" name="' . $context['session_var'] . '" value="' . $context['session_id'] . '"/>';

return $m[1] . $repl . '</form>';
},
$buffer
);

Since I run 2.0.15, my "QueryString.php" is still given with 2.0.9.
Shall I just manually replace the file after running the auto update or shall another method be prefered?

Many thanks for your support!

Offline Rob Lightbody

  • Charter Member
  • Jr. Member
  • *
  • Posts: 168
  • Gender: Male
  • Rob Lightbody, QE2 Story Forum administrator
    • The QE2 Story
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #8 on: December 29, 2019, 08:54:41 AM »
I'm all sorted now, thanks for your help on this!

Offline AlanDewey

  • Semi-Newbie
  • *
  • Posts: 67
    • CCS Forum
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #9 on: December 29, 2019, 09:04:47 AM »
for other noobs,

here is a    Review & Summary    of this fix   ( ShawnB61 was correct and helpful... I just had to 'sleep on it' one night and this morning it made sense to this noob.   (This is the first time I ever upgraded.))

find   Profile-Modify.php  in the /sources directory

fine the line   
Quote
// No size, then it's probably not a valid pic.   
   and then   ADD THE EXTRA COMMENT !

Code: [Select]
$sizes = @getimagesize($_FILES['attachment']['tmp_name']);

// No size, then it's probably not a valid pic.
// No size, then it's probably not a valid pic.
if ($sizes === false)

Then run the package manager and magic will happen  :D  :D  :D  :D  :D   

My forum is now   2.0.16 :-)    Thank you very much, Shawnb61
Glorified Janitor

Offline Alain Rheault

  • Semi-Newbie
  • *
  • Posts: 16
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #10 on: December 29, 2019, 01:16:17 PM »
  8)  Did the update of the CLONE of my Forum ... and it went FINE !   many Thanks  for 2.0.16 version !

I did not give my ID and Password,  changed the line of sécuty  with = 1 instead of = 0 ,  your script for that little bypass process work whell for me ! 

Now --- i'm doing some test on the CLONE and tomorow i will upgrade tje real one     O:)

Offline rty42

  • Newbie
  • *
  • Posts: 7
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #11 on: December 30, 2019, 12:24:00 PM »
This seems weird to me. I have four SMF 2.0.15 forums to upgrade, all of them has this upgrade issue.
I checked the two simple cases (one has only a single MOD (like posts) and the other has one MOD and three smiley packs), and found that no mods affecting Profile-Modify.php is present on any of them. I even uninstalled the single MOD to have a plain MOD-free SMF 2.0.15 and the update still failed because of the lack of the double comment.

My suspicion is that whenever the double comment got introduced to this file it only appeared in the full installation package, but did not appear in the file when updating a forum from an earlier version. All my forums are relatively old, I see "SMF 2.0.4 Update" in the package manager at all of them so I thing they were installed as 2.0.3 or even earlier...

I do the upgrade by manually adding the duplicate comment as suggested and it works for me too, but this issue may affect a lot of users... so maybe making the removal of the extra comment optional would be a good idea.

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,918
    • sbulen on GitHub
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #12 on: December 30, 2019, 12:55:21 PM »
My suspicion is that whenever the double comment got introduced to this file it only appeared in the full installation package, but did not appear in the file when updating a forum from an earlier version. All my forums are relatively old, I see "SMF 2.0.4 Update" in the package manager at all of them so I thing they were installed as 2.0.3 or even earlier...

I do the upgrade by manually adding the duplicate comment as suggested and it works for me too, but this issue may affect a lot of users... so maybe making the removal of the extra comment optional would be a good idea.

Thanks for that input - helpful.  Not sure we can do anything about it as the patch is out in the wild already.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,107
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #13 on: December 30, 2019, 01:48:53 PM »
I noticed that too on my files, I first thought it was my mods. I checked my mods but nothing edited that part/file either.
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline shawnb61

  • Developer
  • SMF Hero
  • *
  • Posts: 1,918
    • sbulen on GitHub
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #14 on: December 30, 2019, 05:08:16 PM »
I saw it on my prod forum, patched since 1.1.   (I assumed I cleaned it up at some point...  Things like that drive me nuts...)

I did not see it on any of my test environments, variants of installs & patches from 2.0.13 or later. 

I think rty42 is correct - it will affect older forums. 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

Offline Vince S

  • Jr. Member
  • **
  • Posts: 263
  • Gender: Male
  • Binary biker, 1 position
    • Hunter Ducati Owners Group Inc
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #15 on: January 30, 2020, 11:57:18 PM »
Still an issue. Our forum has various mods and has existed since 1.0.bugger all. Putting the duplicate comment in as per summarised by Alan on 30th Dec fixed it, went through smoothly then. I am guessing there are a lot out there on 2.0.15 that will not see 2.0.16 and hoping 2.0.17 sorts it. Perhaps this is sufficient justification to warrant the release of an interim 2.0.17? Seems like it to me but hey, we are sorted, so it is only those tens of thousands of others.... :)

And here's a PS: OK, so 2.0.17 is out now and that upgraded just fine. The package manager wouldn't tell me about 17 until I had 16 installed. So it turns out this is a road block and the actual 16 package needs to be updated to remove this error and stop a whole bunch of ppl that DIDN'T read these posts getting frozen out on 2.0.15...
« Last Edit: January 31, 2020, 12:11:12 AM by Vince S »
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Offline Tomcraft

  • Jr. Member
  • **
  • Posts: 131
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #16 on: January 31, 2020, 04:02:05 AM »
I saw it on my prod forum, patched since 1.1.   (I assumed I cleaned it up at some point...  Things like that drive me nuts...)

I did not see it on any of my test environments, variants of installs & patches from 2.0.13 or later. 

I think rty42 is correct - it will affect older forums.

Yes, he is right. The duplicate comment line came in full version of SMF 2.0.6 (but seems like it was not added in the update patch), so if you started your forum with an earlier version of SMF you will not have the duplicate comment line and need to manually duplicate the line for the package manager to work.

Regards, Torsten

Offline Vince S

  • Jr. Member
  • **
  • Posts: 263
  • Gender: Male
  • Binary biker, 1 position
    • Hunter Ducati Owners Group Inc
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #17 on: January 31, 2020, 09:02:29 PM »
So that means it IS broke. No old forum user will get to upgrade past 2.0.15, unless they come and do this dysfunctional double comment solution thing.

Looks like a 'crisis point', sounds like one. Smells like one.

Lucky we didn't tread in it!!!

Hang on, IT'S A CRISIS FOR SMF, anyone going to figure out a solution and get it implemented?

The only solution I can see is that the 2.0.16 upgrader needs to be modified so it doesn't generate the fatal fail. The status quo of expecting all the long term users to come and find this bs trip point that renders their forums un-upgradeable by (most) mere mortals, and that all of them make this mod of ridiculousness to get over a hurdle that snuck out the gate and torched the ecosystem is kinda, well, totally (fill in your expletive of choice).

IT'S A CRISIS PEOPLE, and wrecks all the good work that has come after 2.0.15 by all those cool hard working volunteer types; please deal with it effectively. Thank you.
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....

Offline Illori

  • Project Manager
  • SMF Legend
  • *
  • Posts: 52,245
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #18 on: February 01, 2020, 05:58:37 AM »
we do not modify a patch after it has been released. so this has to be fixed by users posting on the forum asking for assistance.

Offline Vince S

  • Jr. Member
  • **
  • Posts: 263
  • Gender: Male
  • Binary biker, 1 position
    • Hunter Ducati Owners Group Inc
Re: upgrade 2.0.15 --> 2.0.16 fail
« Reply #19 on: February 01, 2020, 06:16:00 AM »
Any other time I would agree with that, except when it gives a la-la land outcome. All those mums 'n dads forums out there using smf will have about 5% who are software savvy. Heck it could be 15%. The rest just want nice forum software and if it doesn't work properly they just work around it. This is reality.

So the questions are:

1) Roughly how many pre 2.06 (is it?) SMF's are out there? Multiply that by 90% (say) and get a number. How does that compare to the 900 or so that have looked at this topic (presumably actually 90 ish if they all looked at every post) in the month since the issue first surfaced? So we have a number of 'potential victims'.

2) The ONLY ways for such affected persons to get through the problem are to find this topic AND be able to implement it (lost 50% there), OR do a reinstall.

3) Looking at the above numbers, does anybody care?

This kind of issue is so 'special' that all standard protocols become irrelevant. The whole purpose of SMF was to get good forum software out there in the hands of all those small operatives that could really use something free and good. And it is now broken, and staying broken, for whatever number of real actual people you care to dream up from the above.

'We' are a lot better than that. It is broke and there is no excuse for not fixing it. Or simple reality is that 2.0.15 is as good as it gets for rather a lot of people and no amount of vacuous 'protocol' on some forum will change that. It needs fixing, and soon. I would think an 'all users' notice is also mandatory to inform situation and advise actions.
Try figuring out where all this is going to keep coming from: Millionaire Baby? Or just pass me a beer and we'll sort it, thank you.....