siemens / siapp-sdk

Software Development Kit to build SIAPPs
Other
20 stars 12 forks source link

Issue with json.loads() #10

Closed lucasschramm1 closed 7 months ago

lucasschramm1 commented 7 months ago

Hello,

I tried building the included DemoProject and ran into the following issue:

Line 138 and 171 (they are identical): container_json = json.loads(subprocess.check_output([_tool(), 'inspect', container_name]))[0]

raise JSONDecodeError("Expecting value", s, err.value) from None json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I fixed this by trimming down the output of the "suprocess.check:output" to only include the JSON structure using the following code:

command_output = subprocess.check_output([_tool(), 'inspect', container_name]) output_str = command_output.decode('utf-8') json_start_index = output_str.find('[') json_data = output_str[json_start_index:] container_json = json.loads(json_data)[0]

With this addition I was able to build the DemoProject SIAPP, but I think this should be something to note.

lukas-wimmer commented 7 months ago

Hello, Thank you for your feedback.

Can you give us a little more information about your setup? Do you use Docker or Podman? WSL, Linux or Windows based? Which version is used for your container runtime environment Which version is used for python?

Thanks a lot in advance. Lukas

lucasschramm1 commented 7 months ago

Hello,

here are some more informations about my Setup: I am using Docker Version 4.27.1 (136059) running on Windows 10 22H2. My Python version is 3.12.2, the latest one downloaded from python.org.

Greetings

Lucas

lukas-wimmer commented 7 months ago

Thanks for the information. We will try to reproduce this and get back to you here.

lukas-wimmer commented 7 months ago

Thanks for contributing we have applied your changes to the master