Skip to content

Windows: [infrabox] Job failed: environment can only contain strings #20

@greggw124

Description

@greggw124

This happens with docker-compose and may also happen with docker (non-compose) on the Windows operating system.

I used a workaround in run.py to encode the secret and non-secret names and values to ascii rather than unicode. I am not sure if this is the correct fix or not.

e.g.
env[name.encode('ascii', 'ignore')] = get_secret(args, value['$secret']).encode('ascii', 'ignore')

Error:
Traceback (most recent call last):
File "c:\Python27\lib\site-packages\infraboxcli\run.py", line 405, in build_and_run
build_and_run_docker_compose(args, job)
File "c:\Python27\lib\site-packages\infraboxcli\run.py", line 234, in build_and_run_docker_compose
ignore_output=False)
File "c:\Python27\lib\site-packages\infraboxcli\execute.py", line 18, in execute
universal_newlines=True)
File "c:\Python27\lib\subprocess.py", line 394, in init
errread, errwrite)
File "c:\Python27\lib\subprocess.py", line 644, in _execute_child
startupinfo)
TypeError: environment can only contain strings
[infrabox] Job failed: environment can only contain strings

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions