Skip to content

Make sure we use python from /usr/local environment in crontab proxy renewal #1588

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

khurtado
Copy link
Contributor

@khurtado khurtado commented Mar 31, 2025

This is related to the MM comment below:

https://mattermost.web.cern.ch/cms-o-and-c/pl/t816wz1xpfyzjmdzzmio1nx99h

When proxies are renewed via crontab, /usr/bin/python is used, but we deploy our python in /usr/local/bin.

Solutions are to either enforce /usr/local/bin as part of PATH in the environment that crontab sees while executing this, or simply enforcing /usr/local/bin/python, which is the python version we use. This solution does the latter, as it is the simplest one.

If the future python 3.12 will be installed in /usr/local/bin as well, this should be compatible.

2025-03-30T12:55+00:00
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'WMCore'
MyProxy v6.2 Aug 2019 PAM SASL KRB5 LDAP VOMS OCSP
Attempting to connect to 2001:1458:d00:4a::100:480:7512
Successfully connected to myproxy.cern.ch:7512
using trusted certificates directory /etc/grid-security/certificates
Using Host cert file (/data/certs/servicecert.pem), key file (/data/certs/servicekey.pem)
server name: /DC=ch/DC=cern/OU=computers/CN=px501.cern.ch
checking that server name is acceptable...
server name matches "myproxy.cern.ch"
authenticated server name is acceptable
A credential has been received for user amaltaro in /data/certs/mynewproxy.pem.
Contacting voms-cms-auth.cern.ch:443 [/DC=ch/DC=cern/OU=computers/CN=cms-auth.cern.ch] "cms"...
Remote VOMS server contacted succesfully. 

@khurtado khurtado changed the title Make sure we use python from /usr/local environment Make sure we use python from /usr/local environment in crontab proxy renewal Mar 31, 2025
@@ -1,7 +1,7 @@
#!/bin/bash

### The main manage script for WMAgent
WMCoreVersion=$(python -c "from WMCore import __version__ as WMCoreVersion; print(WMCoreVersion)")
WMCoreVersion=$(/usr/local/bin/python -c "from WMCore import __version__ as WMCoreVersion; print(WMCoreVersion)")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khurtado this may provide a solution for some containers, but will break many things in the virtual environment and for T0.

Could we avoid using hardcoded && absolute paths in our setups. we have a very well defined environment now and we must always start from the root of the WMAgent deployment, which is referred through: the $WMA_DEPLOY_DIR variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants