PAL_ERROR_INVAL when using loader.env_src_file with GSC #1636
-
Hello, I am currently facing an error when launching an enclave using GSC using env_src_file.
I am trying to feed some environment variables that will be used by the entrypoint of the base image. My current entrypoint (last line in the base dockerfile):
Then on the sgx manifest I have the following related pieces: fs.mounts = [ sgx.allowed_files = [ loader.env_src_file = "file:/mnt/app/argv" Note: I have been explained before that using allowed_files and fs.mounts for the same path file, doesn't make sense, actually they are mutually exclusive (the statement was made here: #1575 (comment)) But the issue is that, I was getting Permission denied, for the mounted argv file that I am mounting from the host to the container when just using the fs.mounts. Generation of the env argv file: gramine-argv-serializer "the_binary" "THE_ENV_VAR" > /mnt/app/argv This generates the file on the host, and when changing the entrypoint of my graminized to a simple bash, I can see that the file has been correctly mounted to the container. For reference, I believe the error might be coming from one of this places (maybe): Line 167 in 94fcedf Line 171 in 94fcedf Line 195 in 94fcedf What am I missing here? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are confusing command-line arguments ( If you want to use environment variables, then you need to specify them as proper envvars: Is it confusing that the tool is called
That's not exactly correct. The statement was made for
But why? This is not environment variables, this is just a command-line argument that looks like an environment variable... |
Beta Was this translation helpful? Give feedback.
You are confusing command-line arguments (
argv
for short) and environment variables (envs
orenvp
for short).If you want to use environment variables, then you need to specify them as proper envvars:
gramine-argv-serializer "ENVVAR1=VALUE1" "ENVVAR2=VALUE2" > /mnt/app/envs
Is it confusing that the tool is called
gramine-argv-serializer
? This tool is used both for argv and for envs.That's not exactly correct. The statement was made for
sgx.allowed_files
andfs.mounts = { type="encrypted" }
…