News:

Wondering if this will always be free?  See why free is better.

Main Menu

failed upgrade autopsy (2.0.14 to 2.0.15)

Started by brynn, January 28, 2018, 09:35:12 PM

Previous topic - Next topic

brynn

As far as I recall, I did have to make some file edits to uninstall it.  Of course I could have made a mistake with it.  But it was like 2 or 3 edits, not everything I see in the manual installation instructions.  Yes, that will take some time!

Ok, I'll start with manually uninstalling PM Attachments in IC.  And meanwhile, below is all the info for reinstalling Stop Spammer in ICD.




7 failed tests for ./Sources/ManageMembers.php  (attached)

Note that as far as I can tell, all the Replace code is already in the file.  It's just I can't find anything close to the Find codes.
Also note that Find/Replace #1 and Find/Replace #5 appear to be identical - not sure why? Also, #3 and #6 also appear to be identical. And also #4 and #7 look identical.

Find #1:
'sprintf' => array(
'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=profile;u=%1$d">%2$s</a>',
'params' => array(
'id_member' => false,
'member_name' => false,
),
),


Replace #1:
'function' => create_function('$rowData', '
global $scripturl;
$url = strtr($scripturl, array(\'%\' => \'%%\')) . \'?action=profile;u=\' . $rowData[\'id_member\'];
return sprintfspamer($rowData, $url, \'member_name\', 2);
'),


Find #2:
'sprintf' => array(
'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=profile;u=%1$d">%2$s</a>',
'params' => array(
'id_member' => false,
'real_name' => false,
),
),


Replace #2:
'function' => create_function('$rowData', '
global $scripturl;
$url = strtr($scripturl, array(\'%\' => \'%%\')) . \'?action=profile;u=\' . $rowData[\'id_member\'];
return sprintfspamer($rowData, $url, \'real_name\', 0);
'),


Find #3:
'sprintf' => array(
'format' => '<a href="mailto:%1$s">%1$s</a>',
'params' => array(
'email_address' => true,
),
),
'class' => 'windowbg',


Replace #3:
'function' => create_function('$rowData', '
global $scripturl;
$url = \'mailto:\' . $rowData[\'email_address\'];
return sprintfspamer($rowData, $url, \'email_address\', 3);
'),


Find #4:
'sprintf' => array(
'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=trackip;searchip=%1$s">%1$s</a>',
'params' => array(
'member_ip' => false,
),
),


Replace #4:
'function' => create_function('$rowData', '
global $scripturl;
$url = strtr($scripturl, array(\'%\' => \'%%\')) . \'?action=trackip;searchip=\' . $rowData[\'member_ip\'];
return sprintfspamer($rowData, $url, \'member_ip\', 1);
'),


Find #5:
'sprintf' => array(
'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=profile;u=%1$d">%2$s</a>',
'params' => array(
'id_member' => false,
'member_name' => false,
),
),


Replace #5:
'function' => create_function('$rowData', '
global $scripturl;
$url = strtr($scripturl, array(\'%\' => \'%%\')) . \'?action=profile;u=\' . $rowData[\'id_member\'];
return sprintfspamer($rowData, $url, \'member_name\', 2);
'),


Find #6:
'sprintf' => array(
'format' => '<a href="mailto:%1$s">%1$s</a>',
'params' => array(
'email_address' => true,
),
),
'class' => 'windowbg',


Replace #6:
'function' => create_function('$rowData', '
global $scripturl;
$url = \'mailto:\' . $rowData[\'email_address\'];
return sprintfspamer($rowData, $url, \'email_address\', 3);
'),


Find #7:
'sprintf' => array(
'format' => '<a href="' . strtr($scripturl, array('%' => '%%')) . '?action=trackip;searchip=%1$s">%1$s</a>',
'params' => array(
'member_ip' => false,
),
),


Replace #7:
'function' => create_function('$rowData', '
global $scripturl;
$url = strtr($scripturl, array(\'%\' => \'%%\')) . \'?action=trackip;searchip=\' . $rowData[\'member_ip\'];
return sprintfspamer($rowData, $url, \'member_ip\', 1);
'),


1 failed test for  ./Sources/Subs.php (attached)

As far as I can tell, (and just like the Replace code for the previous file) the file already shows the correct Replace code.  Not sure why it comes up as a failed test??

Find:
$context['unapproved_members'] = (!empty($modSettings['registration_method']) && $modSettings['registration_method'] == 2) || !empty($modSettings['approveAccountDeletion']) ? $modSettings['unapprovedMembers'] : 0;

Replace:
$context['unapproved_members'] = $modSettings['unapprovedMembers'];

brynn

Oops, another question about manually uninstalling PM Attach.  At the bottom of the manual instructions it has Code and File Operations sections.  I guess I can sort out the File Operations section.  But for the Code section, I don't understand what to do....or undo, as is the case.

For Code, it says

"db_install.php
This file should be able to execute standalone.
add_remove_hooks.php
This file should be able to execute standalone."


Aleksi "Lex" Kilpinen

I'll take a stab at your files above a bit later and get back to you.

For the install scripts, if you have done the uninstall once through the package manager - you should not need to worry about those anymore. :)
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

brynn

Ok, I've plowed through the first 3 files, and found not a single original edit was still in those files.  So far, so good, I guess....

Now for PersonalMessage.php, which we already know has some leftover codes.  The first code change for installing manually, is

Find:
global $txt, $scripturl, $modSettings, $context, $subjects_request

And Add Before:
//
// PM ATTACHMENTS MOD MessageFolder global...
//
global $attachments;
//
// PM ATTACHMENTS MOD END!!
//


If I understand what I'm supposed to do, I should expect to find the Add Before code, before the Find code.  For manually installing, it was supposed to be placed before.  So that's where I should find it.  Right?

However, I actually find it 2 lines after.

If I understand what I'm doing, I should remove it anyway.  Right?

Does that explain why it wasn't removed during the first attempt to uninstall?  Because Package Manager couldn't find it?



I appreciate your help, whenever you can find time ;)

Thanks agian.

Aleksi "Lex" Kilpinen

Yes, you should be OK by just removing it - and yes, probably that explains why the uninstall didn't catch it correctly.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

brynn

#65
As it turns out, it was only PersonalMessage.php which still was containing edits from PM Attachments mod.  With reasonable confidence, I've fixed all but 2, which are different enough that I can't be sure about them.

The new PersonalMessage.php is attached.  And below are the 2 sets of Find and Whatever, which I can't sort out.  (I'm naming them A and B to help avoid confusion with the Stop Spammer message and codes.)

Find A:
// Got some known members?

Add Before A:
checkSession('request');



The problem I have with that is that Find code is on line 2132.  Searching for the Add Before code, I find it on both line 2123 and line 2602.  Possibly the one on line 2123 would be the correct one to remove, but since it's separated by 9 lines, I'm just not sure.  Plus there's the 2nd occurrence which I have no idea what to think about.

Find B:
// Do the actual deletion.
$smcFunc['db_query']('', '
UPDATE {db_prefix}pm_recipients
SET deleted = {int:is_deleted}
WHERE id_member IN ({array_int:member_list})
AND deleted = {int:not_deleted}' . $where,
array(


Add After B:
'blank_string' => '',

In this case, the file contains an extra line among the Find code, so I'm not 100% sure if it's the correct Find code.  In between the line which starts SET deleted, and the line which starts WHERE id_ is a line having something to do with "blank string".  Here, the Add After code is immediately after the Find code.  But since it's about "blank string" and the extra line in the find code is about "blank string"....well, it's just not a clear choice what to do.

Next I'll start on the File Operations section, and reverse those.  Edit - if they haven't already been reversed.  (Edit #2 -- "reversing" those would just be deleting them, I guess?) (Hhmm, maybe I'll just download, just in case , so if it's there's a mistake, I can put it back....)

Thanks again  :)

brynn

Ok, except for those 2 edits, I've finished the manual uninstall!

Aleksi "Lex" Kilpinen

Quote from: brynn on February 11, 2018, 12:25:10 PM
As it turns out, it was only PersonalMessage.php which still was containing edits from PM Attachments mod.  With reasonable confidence, I've fixed all but 2, which are different enough that I can't be sure about them.

The new PersonalMessage.php is attached.  And below are the 2 sets of Find and Whatever, which I can't sort out.  (I'm naming them A and B to help avoid confusion with the Stop Spammer message and codes.)
This would seem to me that you can probably remove the checkSession on line 2123 in section //An error in the message

And probably edit the //do the actual deletion section to be this


// Do the actual deletion.
$smcFunc['db_query']('', '
UPDATE {db_prefix}pm_recipients
SET deleted = {int:is_deleted}
WHERE id_member IN ({array_int:member_list})
AND deleted = {int:not_deleted}' . $where,
array(

'member_list' => $owner,
'is_deleted' => 1,
'not_deleted' => 0,
'pm_list' => $personal_messages !== null ? array_unique($personal_messages) : array(),
)


BUT, do note that now I am partly guessing - because I have not compared your code to each and every one of your mods.
So test it with caution, and keep an eye on your error log.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Aleksi "Lex" Kilpinen

Quote from: brynn on February 11, 2018, 06:01:25 AM
And meanwhile, below is all the info for reinstalling Stop Spammer in ICD.
For these, ALL the edits you mentioned seem to be there already - so they fail because they can not find the original lines they are told to edit.
You should be fine using the attached Subs and Managemembers I think.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

brynn

Ok, re Stop Spammer, you're saying to just ignore the failed tests and install it anyway, without making any edits?

I can easily do that, considering your comments as instructions (or suggestion).  But I couldn't be more confused about why there are the failed test errors, if the correct code is already there.

When.....well, I'm not sure what to call it, other than "it"....I guess it's a script, or some kind of codes, which performs the installation?  So "it" is looking for certain codes, pretty much as a landmark.  Once it finds that landmark, "it" either replaces the landmark, or adds more code before or after the landmark.

So if it doesn't find the landmark, it just....gives up?  Is the reason it doesn't look any further, because at this point, human thought and reasoning is needed?



Re PMs.....  Geez, talk about a long, strange trip!  Ok....unless I'm forgetting something, I just need to upload/overwrite PersonalMessage.php.


Aleksi "Lex" Kilpinen

Yeah, you seem to have understood right. The script is "dumb" if it can not find exactly what it is looking for, it will call on the admin to see what is happening, and will not try to make educated guesses on it's own.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

brynn

Some good news anyway.  The re-installation of Stop Spammer (in ICD forum) seems to have been successful.  I just cleared out all the spam which came through while it was uninstalled, reported the spammers, and removed them too.

Not such good news with PMs.  After I upload/overwrite PersonalMessage.php, when I try to visit My Messages tab, I just get a blank white page in the browser.  Even though you had fixed it once before, I had to make many edits during manually uninstalling PM Attachments.  So I probably did something wrong somewhere.

May I impose yet again, and ask if you can have a look?  Or I would welcome help from anyone, if Lex isn't available.

PersonalMessage-Lex.php is the file you fixed the first time.
PersonalMessage-brynn.php is the file after I manually re-uninstalled PM Attachments mod.

Is there any other info or files I can provide?

brynn


Illori

which log? there should be something in the server error log.

brynn

I meant in the forum's Error Log, in the admin panel.  But I don't see any errors on the server either - well, not that's related to either my IP or PMs.

Illori

there should be one on the server error log especially if you are getting a white screen or a 500 error.

brynn

No 500 error, just blank white page.

I'll re-upload and try to trigger some kind of error.

Aleksi "Lex" Kilpinen

The white page is usually a PHP error and should end up in a server error log. With a quick look at your file, I didn't notice any obvious cause for a white page, so the error log would be a good place to turn to.
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

brynn

No I don't see any errors in cPanel.  I've been looking in WHM, but so far, I can't find anything like an error log.

I looked in the Raw Access (edit) Visitor Log (cPanel), and found where I had browsed to the My Messages tab.  It shows that the icons and smiley's and such, did not load, because for for Size, it shows 0 bytes. 

But I don't see any Errors.

I'll keep looking.

Aleksi "Lex" Kilpinen

Depending on the setup, it can usually be accessed either through the control panel directly,
or is saved as a file called error.log, errorlog. or similar in a place you can access.

I think the current default location for cPanel is .../USER/logs/error.log
Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

How you can help SMF

Advertisement: