contao-manager icon indicating copy to clipboard operation
contao-manager copied to clipboard

Possibility to disable/ignore `contao:maintenance-mode enable`

Open fritzmg opened this issue 1 year ago • 11 comments

The recent Twig BC breaks showed that you can inadvertently maneuver Contao into a broken state of which you cannot get out of via the Contao Manager alone. The update to twig/twig 3.10.1 breaks the contao:maintenance-mode enable command. To fix these BC issues a downgrade to twig/twig 3.9.x is necessary (appropriate conflicts were added to contao/conflicts for this). However, this is impossible to do via the Contao Manager, as it always wants to execute contao:maintenance-mode enable first - which fails. And thus the subsequent composer update - which would execute the downgrade to fix the issue - is never executed.

There needs to be a way to run a composer update directly (i.e. without prior execution of contao:maintenance-mode enable).

fritzmg avatar May 13 '24 15:05 fritzmg

Btw. in this situation the safe mode is not offered. The safe mode would help as contao:maintenance-mode enable is not executed there. May be there just needs to be a way to manually enable the safe mode?

fritzmg avatar May 13 '24 15:05 fritzmg

I think the maintenance task just needs to be accepted to fail, right?

aschempp avatar May 13 '24 15:05 aschempp

I think the maintenance task just needs to be accepted to fail, right?

Not sure, depends on what the user wants I think. There might be other situations where you do not want the composer update or composer install to go ahead if the maintenance mode cannot be enabled.

fritzmg avatar May 13 '24 15:05 fritzmg

An EnableSafemode within the maintenance view wouldn't hurt (currently implementing it and trying to test my dev build if it runs through with 3.10.1 in safemode as well)

zoglo avatar May 13 '24 15:05 zoglo

@fritzmg Having safe-mode on wouldn't solve the issue in this case :/ - I was on 3.10.0 when testing it, hence why it bypassed it.

@aschempp It would help if we would completely skip enabling the maintenance-mode whilst installing within safe-mode since it's usally something when stuff is already broken (or if I add it as an extra option, an expert-setting).

Wdyt?

zoglo avatar May 13 '24 16:05 zoglo

An EnableSafemode within the maintenance view wouldn't hurt (currently implementing it and trying to test my dev build if it runs through with 3.10.1 in safemode as well)

I don't like that option. It would mean that a user has to know internals to know how to fix the system. The Contao Manager should either skip the maintenance mode if it breaks, or possibly allow the task to continue otherwise. Enabling the safe mode manually makes little sense to me.

aschempp avatar May 15 '24 08:05 aschempp

You basically mean a rerun when an error occured that doesn't enable the maintenance mode at all, right?

zoglo avatar May 15 '24 11:05 zoglo

But again, that's may be not something you want. If an error occurs, you might not want to continue at all.

fritzmg avatar May 15 '24 12:05 fritzmg

So what would you propose @fritzmg ? If we wanna keep it as simple as possible for the normal user, it should retry without the maintenance mode then, do you agree?

zoglo avatar May 20 '24 11:05 zoglo

Ideally the Contao Manager would ask the user to confirm to continue without enabling maintenance mode - but putting another UI layer like that in is presumably hard 🙈.

fritzmg avatar May 20 '24 11:05 fritzmg

I think we need to have tasks that are allowed to fail and the user can then choose whether to continue or not. I have some ideas how to implement that 😊

aschempp avatar May 22 '24 09:05 aschempp

Implemented in 4d11c8fae18c0b25949d738b391d241f7d1e95b5

aschempp avatar Mar 14 '25 17:03 aschempp