leapp-repository icon indicating copy to clipboard operation
leapp-repository copied to clipboard

Python error during leapp upgrade.

Open toddr opened this issue 1 year ago • 1 comments

When running leapp upgrade from cpanel-elevate, the user is encountering the following python failure:

* 2023-02-23 15:17:23 (1412) [INFO] ******************************************************************************************
* 2023-02-23 15:17:23 (1413) [INFO] *
* 2023-02-23 15:17:23 (1414) [INFO] * Starting stage 3 of 5
* 2023-02-23 15:17:23 (1415) [INFO] *
* 2023-02-23 15:17:23 (1416) [INFO] ******************************************************************************************
* 2023-02-23 15:17:23 (1169) [INFO] Stage 3: skipping prep_for_leapp (already run)
* 2023-02-23 15:17:23 (1713) [INFO] Running leapp upgrade
* 2023-02-23 15:17:23 (4078) [INFO] Running: /usr/bin/leapp upgrade
* 2023-02-23 15:17:23 (4079) [INFO] 
* 2023-02-23 15:17:23 (4093) [INFO] Traceback (most recent call last):
* 2023-02-23 15:17:23 (4093) [INFO]   File "/usr/bin/leapp", line 5, in <module>
* 2023-02-23 15:17:23 (4093) [INFO]     from pkg_resources import load_entry_point
* 2023-02-23 15:17:23 (4093) [INFO]   File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 72, in <module>
* 2023-02-23 15:17:23 (4093) [INFO]     import packaging.requirements
* 2023-02-23 15:17:23 (4093) [INFO]   File "/usr/lib/python2.7/site-packages/packaging/requirements.py", line 60, in <module>
* 2023-02-23 15:17:23 (4093) [INFO]     MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker")
* 2023-02-23 15:17:23 (4093) [INFO] TypeError: __call__() takes exactly 2 arguments (1 given)
* 2023-02-23 15:17:23 (4110) [INFO] 
* 2023-02-23 15:17:23 (657) [INFO] Sending notification: Fail to update to AlmaLinux 8
* 2023-02-23 15:17:23 (662) [ERROR] The elevation process failed during stage 3.
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR] You can continue the process after fixing the errors by running:
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR]     /usr/local/cpanel/scripts/elevate-cpanel --continue
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR] You can check the error log by running:
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR]     /usr/local/cpanel/scripts/elevate-cpanel
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR] Last Error:
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR] The 'leapp upgrade' process failed.
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR] Please investigate, resolve then re-run the following command to continue the update:
* 2023-02-23 15:17:23 (662) [ERROR] 
* 2023-02-23 15:17:23 (662) [ERROR]     /scripts/elevate-cpanel --continue
* 2023-02-23 15:17:23 (529) [FATAL] The 'leapp upgrade' process failed.

I notice:

TypeError: __call__() takes exactly 2 arguments (1 given)

This appears to be a bug in the leapp code that might need correction?

toddr avatar Mar 24 '23 15:03 toddr

Seems pretty strange, as this is happening during import on line 5. I'd guess that in packaging/requirements.py where it is doing MARKER_EXPR = originalTextFor(MARKER_EXPR())("marker") It should be doing MARKER_EXPR = originalTextFor(MARKER_EXPR(), "marker") ...but this is not inside leapp itself, but within something it's requiring from site-packages. Almost makes me think some version of a dependency is not what it is expecting.

I don't suppose this is all that surprising, as after all it's not like we're paranoid and using virtualenv without --system-libs in this project or anything like that to enforce specific versions of python modules. I'd just say this this is more than likely PEBCAK on the user's part, though it'd be hard to figure out without more investigation.

Considering the other fellow in the linked cpanel-elevate case found that a similar issue was due to openssl11-libs being installed, I'd say my thoughts about it being just something odd about the environment as even more likely.

Regardless, no real way of fixing this "class" of bug report without doing what I say is not being done currently -- being paranoid and operating in a virtualenv with specific versions of modules you need bundled with the project.

troglodyne avatar May 16 '23 18:05 troglodyne