Have I just destroyed my site? [plone.app.multilingual problem]

Hi,

while in the admin panel, I thought I would explore the option of having two languages in the website. I had loaded contents prior to activating the second language (english as italian was the default at install time) and I could log in by going to 192.X.X.X:8080/Plone. Plone created two folders Plone/en and Plone/it. I then decided to remove the multilingual support and revert back to italian only. Seeing these two new folder under the home folder /en and /it, I decided to remove them.

Now, when I try to log in at the above link, it redirects the browser automatically to /Plone/it. Having deleted the folder Plone doesn't let me log in anymore saying that the page (Plone/it) does not exist and I have to contact my administrator. Have I lost my intranet site now?

You definitaley need to know what you are doing here or you risk losing loads of work ... :frowning:

Thanks

Update: If I go to the URL /Plone/MyFolder, it will allow me to log in. But then I click on "Home" and it says "THis page does not exist". It seems like my messing around with multilanguage support has automatically assigned /Plone/it to the "Home" link?

Go to the ZMI at /Plone/manage, and along the top, you will see an Undo tab. Are you able to undo the deletions?

What's the right way to do this? start from the most recent changes made by admin all the way back to the first change I made a couple of hours ago by admin i.e. there are several changes made by admin in the last 2 hrs. DO i start from the last going backwards or the other way around do you think?

UPDATE: this is not working as even if I try to undo the most recent admin action, it says "Sorry ..." and if i try to undo earlier actions I get "cannot undo because or more recent actions ..." Looks like ZMI is not going to helps me :frowning:

dm.historical allows you to restore an earlier state.

2 Likes

Mmm, looks complicated. I guess I have a work around which is to point to /Plone/MyFolder rather than just /Plone for now. I'm wondering if I were to create a new site and then copy over all the database folders only like /var/blobstorage and /var/filestorage, do you think I would have a new pristine site? Or are the site settings saved in those folders too?

You might still be able to undo just the transaction that represents the folder deletion.

I don't know how plone.app.multilingual works, but perhaps it is possible to remove the bit of configuration that tries to redirect you to the missing folder.

Already tried deleting the action of delete. I think it was one of these actions that got things broken a bit:

/Plone/fc-delete by admin
/Plone/it/fc-delete by admin

Got this:

Traceback (innermost last):

Module ZPublisher.Publish, line 146, in publish
Module Zope2.App.startup, line 303, in commit
Module transaction._manager, line 131, in commit
Module transaction._transaction, line 310, in commit
Module transaction._transaction, line 301, in commit
Module transaction._transaction, line 446, in _commitResources
Module transaction._transaction, line 423, in _commitResources
Module ZODB.DB, line 1079, in tpc_vote
Module ZODB.mvccadapter, line 256, in tpc_vote
Module ZEO.ClientStorage, line 750, in tpc_vote
Module ZEO.asyncio.client, line 764, in call
Module ZEO.asyncio.client, line 743, in call
Module ZEO.asyncio.client, line 756, in wait_for_result
Module concurrent.futures._base, line 429, in result
Module concurrent.futures._base, line 381, in __get_result
MultipleUndoErrors: Undo error 0x1e62: Undo error 0x1e62: Some data were modified by a later transaction
Undo error 0x3c9e: Undo error 0x3c9e: Some data were modified by a later transaction
Undo error 0x3d5b: Undo error 0x3d5b: Some data were modified by a later transaction
Undo error 0x1e35: Undo error 0x1e35: Some data were modified by a later transaction
Undo error 0x3b50: Undo error 0x3b50: Some data were modified by a later transaction
Undo error 0x0c0b: Undo error 0x0c0b: Some data were modified by a later transaction
Undo error 0x3b44: Undo error 0x3b44: Some data were modified by a later transaction
Undo error 0x3ad6: Undo error 0x3ad6: Some data were modified by a later transaction
Undo error 0x1e65: Undo error 0x1e65: Some data were modified by a later transaction
Undo error 0x34cc: Undo error 0x34cc: Some data were modified by a later transaction
Undo error 0x3979: Undo error 0x3979: Some data were modified by a later transaction
Undo error 0x15: Undo error 0x15: Some data were modified by a later transaction
Undo error 0x2f1b: Undo error 0x2f1b: Some data were modified by a later transaction

UPDATE: I recreated the "it" folder manually and now its letting me log in again when i go to the /Plone URL. I've had to move all my contents into this "it" folder so that I don't have to go to the "content" link all the time to reach my main folders and pages. Its a work around for now.

Try undoing everything all the way back to those delete transactions?

Tried that mate, similar errors. I guess that's because another user was using the intranet while admin was making changes ... my work around seems to do the trick for now. If I ever figure out how to rebuild a site and copy over the databases that may solve the situation.

great that you found a way, now try to avoid it in the future by taking preventive measures... such as good backups. Or install Plone in a VM or container and use snapshots.

This particular behavior is because multilingual support declares permanent redirect (HTTP 301) from the site root to the default language folder. This can be confirmed by trying alternative browser or private browsing mode. Clearing browser cache should make browser to forget the redirect and let it access the site root again.

(If this was the issue, Zope Undo did not help here, because it’s the browser that remembers that redirect, not Plone.)

Removing an extension is often associated with a risk: The associated "uninstall" operation is often much less tested (and in addition much more difficult) than the "install" operation. As a consequence, it might be incomplete or contain bugs. In any case, it is important to uninstall in an "official" way, i.e. via the plone control panel; just removing the code and fixing by hand will likely cause problems (not sure whether you did this).

You can undo more transactions in a single undo operation. Try to undo all transactions since your deletion in a single "Undo".

The undo will fail, it a later transaction (not undone) has modified an object you want to reset - at this transaction would get invalid if the object changed back to an earlier state.

There is an alternative (more difficult) way to go back to an earlier state. You are likely using a FileStorage (i.e. the ZODB state is stored in a file). A FileStorage is in fact a sequence of transaction records, ordered by transaction time. If you know the offset of a transaction record, you can truncate the FileStorage to that offset in order to go back to the state before this transaction. This utility fsdump allows you to get a readable (but incomplete) representation of a FileStorage; this allows you to find out offsets for transactions records.

1 Like

That's because plone.app.multilingual has set a special view as a default view for the Plone site that redirects the user to the proper language folder calculated after checking user preferred languages withthe browser.

Go to /manage_main in your Plone site, then to portal_types and then to Plone Site.

There you will see that language-switcher is set as defaulted view (I don't recall the exact name of the property) you can remove it and you wills be able to see the site again.

As bottom line, we should check that rhe uninstall procedure of plone.app.multilingual does what it should.

2 Likes

Also the Plone Site may also have the 'language-switcher' set as default view (not the portal_types/Plone Site object, but the Plone Site itself). You can check it going to /manage_main at the root of your Plone Site, and clicking on the top "Properties" tab and check the value of the "layout" property. If it's "language-switcher", you can safely delete the property.

1 Like

I have added a PR to remove the language-switcher view from available views when uninstalling plone.app.multilingual: https://github.com/plone/plone.app.multilingual/pull/309

1 Like

@geotux check @zopyx's blog post https://www.zopyx.com/andreas-jung/contents/restoring-an-older-state-of-arbitrary-zope-objects about using dm.historical. Actually, the blog post itself would be a really nice addition to Plone docs. :slight_smile:

1 Like

please make the PR! :slight_smile:

@tkimnguyen I'm don't know exactly what rights about https://www.zopyx.com/andreas-jung/contents/restoring-an-older-state-of-arbitrary-zope-objects, what about just adding some info about dm.historical and then reference the blog post? @zopyx?

Yeah, would be best to have Andreas' permission. But as for referencing the blog post, I would think it's best to put the text right into the docs. We've had external docs links break when sites go offline or content is moved.