# Alien.py fails

**URL:** <https://alice-talk.web.cern.ch/t/alien-py-fails/1344>\
**Category:** O²\
**Created:** [October 10, 2022, 12:00pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344 "2022-10-10T12:00:36Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 12:00pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/1 "2022-10-10T12:00:37Z")

</div>

I see the alien.py fails. The operating system is MAC MONTEREY, M1-chip. Any help is appreciated.  
Thanks in advance.

Enter PEM pass phrase:  
Could NOT establish connection (WebSocket) to ::ffff:137.138.99.139:8097  
SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: self signed certificate in certificate chain (\_ssl.c:997)’)  
Check the logfile: /Users/arvindkhuntia/alien\_py.log  
Enter PEM pass phrase:  
Could NOT establish connection (WebSocket) to ::ffff:137.138.99.140:8097  
SSLCertVerificationError(1, ‘[SSL: CERTIFICATE\_VERIFY\_FAILED] certificate verify failed: self signed certificate in certificate chain (\_ssl.c:997)’)

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 1:09pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/2 "2022-10-10T13:09:33Z")

</div>

Hi! it would seem that you have a problem with your certificate and/or the available collection of authority certificates.  
Send to me the following:

1. `alien.py version`
2. `ALIENPY_DEBUG=1 ALIENPY_DEBUG_FILE=log.txt alien.py pwd` and send me the log.txt
3. `alien.py cert-info`
4. `alien.py cert-verify`

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 1:21pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/3 "2022-10-10T13:21:16Z")

</div>

[log.txt](https://alice-talk.web.cern.ch/uploads/short-url/gzkkHmcKl7XFleRBejZhLRmjt6v.txt) (3.2 KB)

1: alien.py version

alien.py version: 1.4.5

alien.py version date: 20220927\_120245

alien.py version hash: cd50178

alien.py location: /Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/xjalienfs/1.4.5-local1/lib/python/site-packages/alienpy/alien.py

script location: /Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/xjalienfs/1.4.5-local1/bin/alien.py

Interpreter: /opt/homebrew/Cellar/python@3.10/3.10.7/Frameworks/Python.framework/Versions/3.10/bin/python3.10

Python version: 3.10.7 (main, Sep 14 2022, 22:38:23) [Clang 14.0.0 (clang-1400.0.29.102)]

XRootD version: 5.5.0

XRootD path: /Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/XRootD/v5.5.0-local1/lib/python/site-packages/XRootD/client/ **init**.py

2: ALIENPY\_DEBUG=1 ALIENPY\_DEBUG\_FILE=log.txt alien.py pwd

(log.txt attached)

3: alien.py cert-info  
DN \>\>\> DC=ch/DC=cern/OU=Organic Units/OU=Users/CN=akhuntia/CN=788311/CN=Arvind Khuntia

ISSUER \>\>\> DC=ch/DC=cern/CN=CERN Grid Certification Authority

BEGIN \>\>\> 2022-04-11 08:49:41

EXPIRE \>\>\> 2023-04-22 11:20:16

4: alien.py cert-verify

SSL Verification **failed** for /Users/arvindkhuntia/.globus/usercert.pem

@asevcenc Please have a look.

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 1:38pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/4 "2022-10-10T13:38:14Z")

</div>

@akhuntia could you check if CA CERN certs are present:  
`ls -1 /Users/arvindkhuntia/alice/alisw/sw/osx_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA*`

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 1:47pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/5 "2022-10-10T13:47:22Z")

</div>

> [@asevcenc](#):
>
> ls -1 /Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA\*

/Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA.crl\_url  
/Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA.info  
/Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA.pem  
/Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA.signing\_policy

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 1:54pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/6 "2022-10-10T13:54:25Z")

</div>

@akhuntia so, at this point i suspect that you have a network related problem…  
if on lxplus with the same user certificates you can do:  
`/cvmfs/alice.cern.ch/bin/alienv enter xjalienfs`  
then  
`alien.py pwd`  
then both your user certificates and `alien.py` are ok  
and the problem is with your local connection … i suspect that a transparent proxy or vpn interfere with your connection towards CERN…  
Could you please confirm that on lxplus things work?  
Thanks a lot!

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 2:01pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/7 "2022-10-10T14:01:01Z")

</div>

also try by hand:

```auto
openssl verify -CApath /Users/arvindkhuntia/alice/alisw/sw/osx_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates $HOME/.globus/usercert.pem

```

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 2:07pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/8 "2022-10-10T14:07:34Z")

</div>

yes, it is working on lxplus

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 2:07pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/9 "2022-10-10T14:07:43Z")

</div>

```auto
openssl verify -CApath /Users/arvindkhuntia/alice/alisw/sw/osx_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates $HOME/.globus/usercert.pem

```

/AliEn-Runtime/v2-19-le-local1/globus/share/certificates $HOME/.globus/usercert.pem  
/Users/arvindkhuntia/.globus/usercert.pem: DC = ch, DC = cern, OU = Organic Units, OU = Users, CN = akhuntia, CN = 788311, CN = Arvind Khuntia  
error 20 at 0 depth lookup:unable to get local issuer certificate  
4372891180:error:09FFF06C:PEM routines:CRYPTO\_internal:no start line:/AppleInternal/Library/BuildRoots/a0876c02-1788-11ed-b9c4-96898e02b808/Library/Caches/com.apple.xbs/Sources/libressl/libressl-2.8/crypto/pem/pem\_lib.c:684:Expecting: TRUSTED CERTIFICATE  
4372891180:error:0BFFF009:x509 certificate routines:CRYPTO\_internal:PEM lib:/AppleInternal/Library/BuildRoots/a0876c02-1788-11ed-b9c4-96898e02b808/Library/Caches/com.apple.xbs/Sources/libressl/libressl-2.8/crypto/x509/by\_file.c:146:

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 2:26pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/10 "2022-10-10T14:26:26Z")

</div>

could you check that the same certificates are on both machines?  
just run on lxplus and on your machine:

```auto
sha256sum $HOME/.globus/user{cert,key}.pem

```

and compare the outputs

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 2:28pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/11 "2022-10-10T14:28:32Z")

</div>

> [@asevcenc](#):
>
> `sha256sum $HOME/.globus/user{cert,key}.pem`

On lxplus:  
[xjalienfs] FDDEPNDATA \> sha256sum $HOME/.globus/user{cert,key}.pem  
b66eb01a1e38deeaf70534763433dc748b4b8e245de0e91d721a9f7eeb988610 /afs/cern.ch/user/a/akhuntia/.globus/usercert.pem  
8c5e77769def35a9905504fa9e0802e9f2aa44726c3295610d10476481e49f66 /afs/cern.ch/user/a/akhuntia/.globus/userkey.pem

On my laptop:  
[O2/latest] ~/alice/alisw/TestO2/EPN\_data\_may2022/lhcBackground %\> sha256sum $HOME/.globus/user{cert,key}.pem  
b66eb01a1e38deeaf70534763433dc748b4b8e245de0e91d721a9f7eeb988610 /Users/arvindkhuntia/.globus/usercert.pem  
8c5e77769def35a9905504fa9e0802e9f2aa44726c3295610d10476481e49f66 /Users/arvindkhuntia/.globus/userkey.pem

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 2:35pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/12 "2022-10-10T14:35:31Z")

</div>

then compare the hash of CERN-GridCA.pem, in both environments (on your O2/latest on mac and in xjalienfs on lxplus) check:  
`sha256sum $X509_CERT_DIR/CERN-GridCA.pem`  
other than this i ran out of ideas… but it’s clear that something is corrupted on your laptop,  
and it might be a solution to delete everything under $ALIBUILD\_WORK\_DIR (except MIRROR) and try again the build

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 2:40pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/13 "2022-10-10T14:40:08Z")

</div>

lxplus:  
[xjalienfs] FDDEPNDATA \> sha256sum $X509\_CERT\_DIR/CERN-GridCA.pem  
b192dfb7e84a523441c2a10dce555f5e2577973883d944cd5d14a6f4c76b166c /cvmfs/alice.cern.ch/el7-x86\_64/Packages/AliEn-Runtime/v2-19-le-113/globus/share/certificates/CERN-GridCA.pem

Local:  
[O2/latest] ~/alice/alisw/TestO2/EPN\_data\_may2022/lhcBackground %\> sha256sum $X509\_CERT\_DIR/CERN-GridCA.pem  
b192dfb7e84a523441c2a10dce555f5e2577973883d944cd5d14a6f4c76b166c /Users/arvindkhuntia/alice/alisw/sw/osx\_arm64/AliEn-Runtime/v2-19-le-local1/globus/share/certificates/CERN-GridCA.pem

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 10, 2022, 2:56pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/14 "2022-10-10T14:56:15Z")

</div>

I’m sorry, i’m out of ideas…

1. the most basic test for cert verification should work (within the respective environment where X509\_CERT\_DIR is defined and have the collection of CA certificates):  
`openssl verify -CApath $X509_CERT_DIR $HOME/.globus/usercert.pem`

2. this assumes that the involved files (both user{cert,key}.pem and CERN-GridCA.pem) are valid, the the hash shown that the files are the same

3. the basic validation tests on lxplus were successful

so, given that the files are the same, everything works on lxplus, but not on the laptop, i can only blame the network somehow… is the network CERN? if yes, then it cannot be the network (unless is an un-registered device), if no, then try to have the network access through another ISP and see if this change anything

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 3:00pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/15 "2022-10-10T15:00:58Z")

</div>

Now, I am building O2 from scratch. Let’s hope, this will solve the problem.

Thank you very much for your input.

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 10, 2022, 8:43pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/16 "2022-10-10T20:43:11Z")

</div>

Still have the same issues with the new build.

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 11, 2022, 5:22am UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/17 "2022-10-11T05:22:12Z")

</div>

Unfortunately I don’t know what to say… i’m out of ideas …

---

<div class="post-metadata">

**Author:** ![asevcenc](https://alice-talk.web.cern.ch/user_avatar/alice-talk.web.cern.ch/asevcenc/32/65_2.png) [@asevcenc](https://alice-talk.web.cern.ch/u/asevcenc)\
**Post date:** [October 11, 2022, 5:37am UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/18 "2022-10-11T05:37:35Z")

</div>

@akhuntia could you check if your machine have the time synchronized? try to set and enable network synchronization for time like this: [If the date or time is wrong on your Mac - Apple Support](https://support.apple.com/en-us/HT203413)

---

<div class="post-metadata">

**Author:** ![akhuntia](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/a5b964/32.png) [@akhuntia](https://alice-talk.web.cern.ch/u/akhuntia)\
**Post date:** [October 11, 2022, 12:17pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/19 "2022-10-11T12:17:19Z")

</div>

@asevcenc Yes, the time is synchronised.

---

<div class="post-metadata">

**Author:** ![asasikum](https://alice-talk.web.cern.ch/letter_avatar_proxy/v4/letter/a/ba9def/32.png) [@asasikum](https://alice-talk.web.cern.ch/u/asasikum)\
**Post date:** [January 9, 2024, 7:45pm UTC](https://alice-talk.web.cern.ch/t/alien-py-fails/1344/20 "2024-01-09T19:45:15Z")

</div>

Hello,

Does anyone know what could be causing the following error while trying to do alien.py?

```auto
[AliPhysics/latest-master-o2] ~ %> alien.py
/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/urllib3/ __init__.py:34: NotOpenSSLWarning: urllib3 v2 only supports OpenSSL 1.1.1+, currently the 'ssl' module is compiled with 'LibreSSL 2.8.3'. See: https://github.com/urllib3/urllib3/issues/3020
  warnings.warn(
ModuleNotFoundError: No module named '_cffi_backend'
thread '<unnamed>' panicked at /Users/runner/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.18.3/src/err/mod.rs:790:5:
Python API call failed
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Traceback (most recent call last):
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/bin/alien.py", line 5, in <module>
    from alienpy.alien import main
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/alienpy/alien.py", line 53, in <module>
    from .wb_api import InitConnection, SendMsg, cd, get_help_srv, retf_print, token_regen, wb_ping
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/alienpy/wb_api.py", line 25, in <module>
    from .wb_async import IsWbConnected, wb_close, wb_create, wb_sendmsg, wb_sendmsg_multi
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/alienpy/wb_async.py", line 31, in <module>
    from .connect_ssl import create_ssl_context, renewCredFilesInfo
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/alienpy/connect_ssl.py", line 24, in <module>
    import OpenSSL
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/OpenSSL/ __init__.py", line 8, in <module>
    from OpenSSL import SSL, crypto
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/OpenSSL/SSL.py", line 10, in <module>
    from OpenSSL._util import (
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/OpenSSL/_util.py", line 6, in <module>
    from cryptography.hazmat.bindings.openssl.binding import Binding
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/cryptography/hazmat/bindings/openssl/binding.py", line 15, in <module>
    from cryptography.exceptions import InternalError
  File "/Users/anjaly/alice/sw/osx_x86-64/xjalienfs/1.5.7-local1/lib/python/site-packages/cryptography/exceptions.py", line 9, in <module>
    from cryptography.hazmat.bindings._rust import exceptions as rust_exceptions
pyo3_runtime.PanicException: Python API call failed
[AliPhysics/latest-master-o2] ~ %>

```

[Next page](https://alice-talk.web.cern.ch/t/alien-py-fails/1344.md?page=2)
