Force-uninstall a mod?

Started by m4z, September 10, 2019, 12:39:31 PM

Previous topic - Next topic

m4z

Hi, can anybody provide a pointer to, or write down for me, general advice for force-uninstalling broken mods? (I found this very hard to search for and didn't find any generic advice yet.)

I'm having two slightly different problems with the same smiley mod, one that I created (and that's not on the SMF Mod site yet); it's a ripoff an adaption of the Dizzy Smileys mod with different smileys (fugue-icons) and (well, partial) postgres support.

a) In one forum, I removed the smiley set from the Smileys section in the Admin menu; SMF reminded me that the files weren't deleted, only the set in the forum, hence (because I had forgotten it was installed via a package; it was late) I happily removed my Smileys/fugue-icons/ dir. Then I remembered, and tried to uninstall the package, but of course it failed because the dir was missing. I mkdir'ed an empty dir back and now the uninstaller (probably) complains about my missing uninstall files (uninstall.php and smf21_uninstall.php, as defined by the mod). In the uninstall screen, a message that I couldn't read yet flashes for a split second, and then I only see the dialog for providing my FTP data (for an FTP server that I don't run) to fix the files.
My plan was to next restore all the actual smileys that were there, in the hopes that this changes something. I can't figure out where the *uninstall.php files are supposed to be, though (I tested installing the package in another forum but couldn't find them when it was installed).

b) In another forum, my *uninstall code was incorrect (using a wrong data type[0](?) when attempting to remove the smileys from the DB, because I didn't yet know how to adapt that line, and thought I could fix it later), and now apparently the smiley files are gone and can't be found, and uninstall just shows a blank page and the error log point to an error I haven't figured out yet (and no access to the sources right now):
PHP Parse error:  syntax error, unexpected 'fugue' (T_STRING) in [...]/Packages/temp/fugue-icons/smf21_uninstall.php on line 13

Also getting a lot of 8: Undefined index:, will look into what causes them (I remember there's a similar bug in rc2 caused by missing newline in the smiley set names, my adapted code probably broke it...)

Hope to provide more details later today, to help you help me. O:)


[0]: Dizzy Smileys installed an array of two smiley sets while my mod only installs one.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Illori

you may need to manually clear out the database, we don't have a way to fix that.

otherwise we suggest uploading clean files and clearing out any hooks installed. this does not always fix 3rd party themes, avatar packs, or smiley packs.

m4z

Quote from: Illori on September 10, 2019, 12:41:41 PM
you may need to manually clear out the database, we don't have a way to fix that.

You're referring to removing the traces of the mod, not start with a fresh forum, I assume?


Quote from: Illori on September 10, 2019, 12:41:41 PM
otherwise we suggest uploading clean files and clearing out any hooks installed. this does not always fix 3rd party themes, avatar packs, or smiley packs.

From the limited understanding I have of the (probably rather trivial) mod, no files where patched and no hooks installed.
I'll push the sources to GH, so I can provide a better picture.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

shawnb61

The most concerning thing here is that that mod - which won't work properly in 2.1 - gave no errors upon installation to 2.1.

It just changes a couple of the smiley-related settings & copies the new smileys over.  But the settings are different between 2.0 & 2.1. 

I just installed it myself & now I have scores of errors in my error log...  Missing indexes... 
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

m4z

Quote from: shawnb61 on September 10, 2019, 04:27:33 PM
I just installed it myself & now I have scores of errors in my error log...  Missing indexes... 

I assume install.php line 15-17 are causing this. It looks similar to this issue.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Yeah, something is off here, though I might be hit harder because I installed various iterations of the mod O:):

alpha-smf=> select * from alphasmf_settings where variable like 'smiley_sets_%';
      variable       |            value
---------------------+------------------------------
smiley_sets_known   | fugue,dizzy_light,dizzy_dark
smiley_sets_names   | Fugue's Set                 +
                     | Dizzy Light                 +
                     | Dizzy Dark
smiley_sets_default | dizzy_light
(3 rows)
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Ah, the code lines referenced aren't the problem; I also had the original Dizzy Smileys mod installed and (obviously) couldn't complete installation because it doesn't support postgres.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

shawnb61

That looks OK to me - the 3 sets are properly represented.

In 2.0, all you needed was a set of files & those settings.

In 2.1, since we now allow for multiple extension types (no longer just .gif), the filenames can vary per set & even per smiley.  So you have to look at the smileys & the smiley_files tables.  In smiley_files, you need (sets * smileys) entries.
Address the process rather than the outcome.  Then, the outcome becomes more likely.   - Fripp

m4z

Can I just remove my mod line from alphasmf_log_packages, or will I get into trouble with alphasmf_log_packages_seq?


Quote from: shawnb61 on September 10, 2019, 04:42:55 PM
So you have to look at the smileys & the smiley_files tables.  In smiley_files, you need (sets * smileys) entries.

I actually (after removing the dizzy mod) only have the original "fugue" set installed and those look fine:

alpha-smf=> select * from alphasmf_smiley_files;
id_smiley | smiley_set |    filename
-----------+------------+-----------------
         1 | fugue      | smiley.png
         2 | fugue      | wink.png
         3 | fugue      | cheesy.png
         4 | fugue      | grin.png
         5 | fugue      | angry.png
         6 | fugue      | sad.png
         7 | fugue      | shocked.png
         8 | fugue      | cool.png
         9 | fugue      | huh.png
        10 | fugue      | rolleyes.png
        11 | fugue      | tongue.png
        12 | fugue      | embarrassed.png
        13 | fugue      | lipsrsealed.png
        14 | fugue      | undecided.png
        15 | fugue      | kiss.png
        16 | fugue      | cry.png
        17 | fugue      | evil.png
        18 | fugue      | azn.png
        19 | fugue      | afro.png
        20 | fugue      | laugh.png
        21 | fugue      | police.png
        22 | fugue      | angel.png
(22 rows)

alpha-smf=> select * from alphasmf_smileys;
id_smiley | code | description | smiley_row | smiley_order | hidden
-----------+------+-------------+------------+--------------+--------
         1 | :)   | Smiley      |          0 |            0 |      0
         2 | ;)   | Wink        |          0 |            1 |      0
         3 | :D   | Cheesy      |          0 |            2 |      0
         4 | ;D   | Grin        |          0 |            3 |      0
         5 | >:(  | Angry       |          0 |            4 |      0
         6 | :(   | Sad         |          0 |            5 |      0
         7 | :o   | Shocked     |          0 |            6 |      0
         8 | 8)   | Cool        |          0 |            7 |      0
         9 | ???  | Huh?        |          0 |            8 |      0
        10 | ::)  | Roll Eyes   |          0 |            9 |      0
        11 | :P   | Tongue      |          0 |           10 |      0
        12 | :-[  | Embarrassed |          0 |           11 |      0
        13 | :-X  | Lips Sealed |          0 |           12 |      0
        14 | :-\  | Undecided   |          0 |           13 |      0
        15 | :-*  | Kiss        |          0 |           14 |      0
        16 | :'(  | Cry         |          0 |           15 |      0
        17 | >:D  | Evil        |          0 |           16 |      1
        18 | ^-^  | Azn         |          0 |           17 |      1
        19 | O0   | Afro        |          0 |           18 |      1
        20 | :))  | Laugh       |          0 |           19 |      1
        21 | C:-) | Police      |          0 |           20 |      1
        22 | O:-) | Angel       |          0 |           21 |      1
(22 rows)


I think the table was the way you described after install. I had no problems with the actual smiley set when the mod was installed (though maybe the index errors were present, can't be sure) except that only 22 of my 3k+ smileys were showing because of SMF rules.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Quote from: m4z on September 10, 2019, 04:55:00 PM
Can I just remove my mod line from alphasmf_log_packages, or will I get into trouble with alphasmf_log_packages_seq?

After deleting my mod from that table (
alpha-smf=> delete from alphasmf_log_packages where id_install=2;
DELETE 1

), the mod shows as never installed, but I can't install it either, same split-second site text, followed by ftp section only.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Aha, one step further:
Quote
Type of error: General
2: unlink(/home/alpha-smf/public_html/Packages/temp/smf21_uninstall.php): Permission denied
https://(redacted)/index.php?action=admin;area=packages;sa=install;package=1568149439.zip
/home/alpha-smf/public_html/Sources/Subs-Package.php (Line 1815)
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Ok, the empty-except-for-ftp-section installer page meant I had incorrect permissions (I manually created Packages/temp/ and everything below it). Will probaby report this behavior as a bug, it should at least display an error to the admin that's more specific than "some files have incorrect permissions".

Getting close now...
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Ok, my first forum is repaired and I can install and reinstall my mod basically without problems, just uninstalling still makes problems. Updated my GH repo with the current state.

Will attack second forum tomorrow.
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Ok, for completeness, here's what I had to repair in my second forum:

# Remove my set from the smiley sets (don't remember which command changed what exactly in the WebUI)
update betasmf_settings set value='Fugue''s Set'||chr(10)||'Alienine''s Set' where variable='smiley_sets_names';
update betasmf_settings set value='fugue,alienine' where variable='smiley_sets_known';

# Remove my smileys from the "[...]files" table
delete from betasmf_smiley_files where smiley_set='fugue-icons';

# Remove my package from the list
delete from betasmf_log_packages where id_install=3;



Thanks for nudging me into the right direction(s).
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

m4z

Quote from: m4z on September 10, 2019, 05:30:49 PM
Ok, the empty-except-for-ftp-section installer page meant I had incorrect permissions (I manually created Packages/temp/ and everything below it). Will probaby report this behavior as a bug, it should at least display an error to the admin that's more specific than "some files have incorrect permissions".

https://github.com/SimpleMachines/SMF2.1/issues/5856
"Faith is what you have in things that don't exist."
--Homer Simpson

Es gibt hier im Forum ein deutsches Support-Board!

Advertisement: