Bug 161292 - Windows MAR autoupdate breaks the whole application due to python version change
Summary: Windows MAR autoupdate breaks the whole application due to python version change
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
24.2.2.2 release
Hardware: x86-64 (AMD64) Windows (All)
: medium normal
Assignee: Stephan Bergmann
URL:
Whiteboard: target:24.8.0 target:24.2.5 target:24...
Keywords:
Depends on:
Blocks: Automatic-Updater
  Show dependency treegraph
 
Reported: 2024-05-27 09:13 UTC by Ming Hua
Modified: 2024-06-06 14:29 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
log file $PROFILE\updates\updating.log (5.99 KB, text/plain)
2024-05-30 13:17 UTC, Ming Hua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ming Hua 2024-05-27 09:13:59 UTC
I turned on the MAR autoupdate feature for my Windows 24.2 installation.  The update went fine once previously, updating to version 24.2.2.1.  A recent update (around May 24th) broke the whole LibreOffice, however.

When I started the application from a shortcut icon, the autoupdate splash screen appeared and the update process completed.  Then the regular LO splash screen appeared but the application window didn't appear.  Starting application a second time made no difference, only splash screen, no application window.  Starting application from command line revealed more details:

Python path configuration:
  PYTHONHOME = 'D:\Programs\LibreOffice\24.2.autoupdate\program\..\program\python-core-3.8.19'
  PYTHONPATH = 'D:\Programs\LibreOffice\24.2.autoupdate\program\..\program\python-core-3.8.19\lib;D:\Programs\LibreOffice\24.2.autoupdate\program\..\program\python-core-3.8.19\lib\site-packages;D:\Programs\LibreOffice\24.2.autoupdate\program\..\program'
  program name = 'python'
  isolated = 0
  environment = 1
  user site = 1
  import site = 1
  sys._base_executable = 'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\soffice.bin'
  sys.base_prefix = 'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19'
  sys.base_exec_prefix = 'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19'
  sys.executable = 'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\soffice.bin'
  sys.prefix = 'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19'
  sys.exec_prefix = 'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19'
  sys.path = [
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19\\lib',
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19\\lib\\site-packages',
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program',
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\python38.zip',
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19\\DLLs',
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program\\..\\program\\python-core-3.8.19\\lib',
    'D:\\Programs\\LibreOffice\\24.2.autoupdate\\program',
  ]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'

It turns out that after autoupdate, the program\python-core-3.8.18\ (likely the version for LO 24.2.2.1) directory is empty, yet program\python-core-3.8.19\ directory doesn't exist, so LO fails to start due to missing python.

The application doesn't start now so I can't provide accurate version information.  But the following is the version information for the 7.6.7 version installed on the same machine, in case it's helpful:
CPU threads: 12; OS: Windows 10.0 Build 22631; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: en-US
Calc: CL threaded
Comment 1 Maverick 2024-05-27 15:00:25 UTC
I don't know if this is exactly the same problem i experienced (which happened to me only on remote files - Splash screen appears and then "nothing". Local files opened ok, however.)

If this is the same problem, updating to 24.2.3 (already available on Libreoffice's download page) solved the issue!

Please confirm if that's the case!
Comment 2 V Stuart Foote 2024-05-27 16:29:49 UTC
We did have bundled Python3 upgrade between 24.2.0.3 and current 24.2.3.2, from Python python-core-3.8.18 --> python-core-3.8.19

So seems possible the directory could need to be adjusted in the MAR incremental.

=-ref-=

https://gerrit.libreoffice.org/c/core/+/165053
Comment 3 Stephan Bergmann 2024-05-30 11:21:39 UTC
(In reply to Ming Hua from comment #0)
> The application doesn't start now so I can't provide accurate version
> information.

You could please provide two things, just to make sure we all look at the same issue:

* In the LibreOffice installation (presumably `C:\Program Files\LibreOffice\`), there should be a file `program\setup.ini`.  Can you please share its contents here?

* In your LibreOffice user data (presumably `C:\Users\...\Application Data\LibreOffice\4`) there should be file `updates\updating.log`.  Can you please share its contents here?
Comment 4 Ming Hua 2024-05-30 13:17:38 UTC
Created attachment 194458 [details]
log file $PROFILE\updates\updating.log

(In reply to Stephan Bergmann from comment #3)
> You could please provide two things, just to make sure we all look at the
> same issue:
Sure.
 
> * In the LibreOffice installation (presumably `C:\Program
> Files\LibreOffice\`), there should be a file `program\setup.ini`.  Can you
> please share its contents here?
[Bootstrap]
buildid=d56cc158d8a96260b836f100ef4b4ef25d6f1a01
ProductCode={6A2ACEC0-5875-4F4E-A2C8-F4479E3A7229}
UpgradeCode={4B17E523-5D91-4E69-BD96-7FD81CFA81BB}
 
> * In your LibreOffice user data (presumably `C:\Users\...\Application
> Data\LibreOffice\4`) there should be file `updates\updating.log`.  Can you
> please share its contents here?
This file is a bit large so I've added it as attachment.

There is also the file $PROFILE\updates\0\update.log with more details.  Do you want that file as well?
Comment 5 Stephan Bergmann 2024-05-30 15:00:13 UTC
I can reproduce with <https://downloadarchive.documentfoundation.org/libreoffice/old/24.2.2.1/win/x86_64/LibreOffice_24.2.2.1_Win_x86-64.msi> installed (which still has instdir/program/python-core-3.8.18/), which downloads <https://update-mar.libreoffice.org/24.2.2.2/LibreOffice_24.2.2.2_Windows_X86_64_d56cc158d8a96260b836f100ef4b4ef25d6f1a01_from_bf759d854b5ab45b6ef0bfd22e51c6dc4fb8b882_partial.mar> to update to 24.2.2.2.  That version shall have instdir/program/python-core-3.8.19/ instead, and the mar file does contain instructions to remove all of python-core-3.8.18 and to create a new python-core-3.8.19.  And the updating process indeed removes all of the python-core-3.8.18 directory, but it fails to create and populate the python-core-3.8.19 directory.
Comment 6 Commit Notification 2024-05-31 13:06:24 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/c00014019e6d33bfb4729c563062db1645c48e9d

tdf#161292: Fix create-partial-info for newly added files

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Commit Notification 2024-06-03 14:33:43 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

https://git.libreoffice.org/core/commit/f7bd624cf1f2ad51a5f7d0edf23a1f19a9063823

tdf#161292: Fix create-partial-info for newly added files

It will be available in 24.2.5.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2024-06-03 18:17:13 UTC
Stephan Bergmann committed a patch related to this issue.
It has been pushed to "libreoffice-24-2-4":

https://git.libreoffice.org/core/commit/ada4296497bae971c3cb293f934f5e6240f23185

tdf#161292: Fix create-partial-info for newly added files

It will be available in 24.2.4.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Stephan Bergmann 2024-06-06 14:29:14 UTC
The current status with MAR updates available from TDF is as follows:

* The last good update was from 24.2.1 to 24.2.2.1.

* The update from 24.2.2.1 to 24.2.2.2 was broken.  It has been taken off the web meanwhile.  Users who ran this update have a broken installation; they need to manually install a MSI version to get their installation fixed.  With a fix for the underlying issue now available, a fixed update to 24.2.2.2 will be generated and made available soon.

* There will then be further updates from 24.2.2.2 to 24.2.3, etc.