gramineproject / graphene

Graphene / Graphene-SGX - a library OS for Linux multi-process applications, with Intel SGX support
https://grapheneproject.io
GNU Lesser General Public License v3.0
771 stars 260 forks source link

Run graphene-sgx with python examples not work #2564

Closed by202 closed 3 years ago

by202 commented 3 years ago

I have installed the Graphene successfully on the remote ubuntu 20.04 server, however, it seems like not work when I run the python examples (~/graphene/Examples/). For example: graphene-sgx ./python scripts/helloworld.py

The errors are shown as below: error: Could not find size of file: file:/usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480 error: Failed to load the checksums of trusted files: -6

I have no idea how to fix that, any suggestions would be much appreciated!

dimakuv commented 3 years ago

I can't reproduce it. Can you list the exact commands how you build + install Graphene and how you build + run the Python example?

Also, what do you mean by on the remote server?

by202 commented 3 years ago

Thanks so much for the reply.

I can't reproduce it. Can you list the exact commands how you build + install Graphene and how you build + run the Python example?

Also, what do you mean by on the remote server?

Thanks so much for the reply.

1)I followed the steps (https://graphene.readthedocs.io/en/latest/building.html) to install Intel SGX driver and Intel SGX SDK/PSW. The ./app in Simulation mode and Hardware Mode run successfully, everything is good. 2)Then I start to build the SGX with Graphene as doc(https://graphene.readthedocs.io/en/latest/quickstart.html) from step1-6, graphene-sgx helloworld works successfully. 3)Then I change the path to (graphene/Examples/python), and follow the step:(https://github.com/oscarlab/graphene/tree/master/Examples/python). 3.1 $sudo apt-get install libnss-mdns python3-numpy python3-scipy 3.2 $make 3.3 $make SGX=1 3.4 $graphene-sgx ./python scripts/helloworld.py

Now it shows the errors.

Remote server is supposed to the server I need to use "ssh" to connect with. (ssh username@ip)

Thanks so much if you have any suggestions.

dimakuv commented 3 years ago

Interesting. Could you tell me if you have this file /usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480?

Simply copy-paste the output of this command:

ls -la /usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480

I wonder if this file doesn't exist or its size is zero or something like this. I'm also curious about its permissions.

by202 commented 3 years ago

Interesting. Could you tell me if you have this file /usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480?

Simply copy-paste the output of this command:

ls -la /usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480

I wonder if this file doesn't exist or its size is zero or something like this. I'm also curious about its permissions.

Thanks for the reply. It shows "ls: cannot access '/usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480': No such file or directory" when I check it via ls -la /usr/lib/python3.8/pycache/future.cpython-38.pyc.1110420480

After that, I have reinstalled the graphene, check each step very carefully, I found some issue related to the dkms. when I install some packages related to python, it shows "python3-pip is already the newest version (20.0.2-5ubuntu1.6). 0 upgraded, 0 newly installed, 0 to remove and 17 not upgraded. 4 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting uplinux-headers-5.8.0-63-generic(5.8.0-63.71~20.04.1) ... /etc/kernel/header_postinst.d/dkms: dkms: running auto installation service for kernel 5.8.0-63-generic Error! Could not locate dkms.conf file. File: /var/lib/dkms/sgx/1.41/source/dkms.conf does not exist. ...fail run-parts: /etc/kernel/header_postinst.d/dkms exited with return code 4 dpkg: error processing package linux-headers-5.8.0-63-generic (--configure): installed linux-headers-5.8.0-63-generic package post-installation script subprocess returned error exit status 1 dpkg: dependency problems prevent configuration of linux-headers-generic-hwe-20.04: linux-headers-generic-hwe-20.04 depends on linux-headers-5.8.0-63-generic; however: Package linux-headers-5.8.0-63-generic is not configured yet.

dpkg: error processing package linux-headers-generic-hwe-20.04 (--configure): dependency problems - leaving unconfigured Setting up linux-image-5.8.0-63-generic (5.8.0-63.71~20.04.1) ... No apport report written because the error message indicates its a followup error from a previous failure.

dpkg: dependency problems prevent configuration of linux-generic-hwe-20.04: linux-generic-hwe-20.04 depends on linux-headers-generic-hwe-20.04 (= 5.8.0.63.71~20.04.45); however: Package linux-headers-generic-hwe-20.04 is not configured yet.

pkg: error processing package linux-generic-hwe-20.04 (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure.

Processing triggers for linux-image-5.8.0-63-generic (5.8.0-63.71~20.04.1) ... /etc/kernel/postinst.d/dkms:

..fail! run-parts: /etc/kernel/postinst.d/dkms exited with return code 4 dpkg: error processing package linux-image-5.8.0-63-generic (--configure): installed linux-image-5.8.0-63-generic package post-installation script subprocess returned error exit status 1 No apport report written because MaxReports is reached already Errors were encountered while processing: linux-headers-5.8.0-63-generic linux-headers-generic-hwe-20.04 linux-generic-hwe-20.04 linux-image-5.8.0-63-generic E: Sub-process /usr/bin/dpkg returned an error code (1)"

Note that I have updated the Linux kernel to 5.11 (5.11.1-051101-generic)before graphene installation. And I use the dpkg --list | grep linux-image to check the kernel I have: linux-image-5.8.0-(43~63)-generic, linux-image-generic-hwe-20.04, linux-image-unsigned-5.11.1-051101-generic 5.11.1-051101.202103031212, linux-image-unsigned-5.9.0-050900-generic 5.9.0-050900.202010112230.

Can you shed any light on this at all? I’d appreciate any guidance which may help me resolve the problem.

dimakuv commented 3 years ago

Sorry, the error that you have with dkms is not related to Graphene. Looks like something got corrupted on your machine after you updated to the newer Linux kernel. Please google how to fix this.