Skip to content

v3.0.1 causes error: "invalid character '/' looking for beginning of value" #139

@pdcastro

Description

@pdcastro

docker-modem v3.0.1 / PR #133 (then modified by PR #134 / v3.0.2) introduced a bug that manifests as the following image build error message when the build options include a volumes array -

{
  volumes: [ '/var/lib/docker/tmp:/var/lib/docker/tmp:rw' ],
  ...
}
(HTTP code 500) server error - invalid character '/' looking for beginning of value

I had already added a comment to the PR itself (#133 (comment)). Now creating this issue so that the comment does not get forgotten too easily.

The query string produced by the buildQuerystring function (see #133) is:

Before PR #133:

't=balena-secrets%3Alatest&volumes=%5B%22%2Fvar%2Flib%2Fdocker%2Ftmp%3A%2Fvar%2Flib%2Fdocker%2Ftmp%3Arw%22%5D&forcerm=true'

→ The volumes array was stringified as '["/var/lib/docker/tmp:/var/lib/docker/tmp:rw"]' prior to conversion to a query string, and the image build would succeed.

After PR #133:

't=balena-secrets%3Alatest&volumes=%2Fvar%2Flib%2Fdocker%2Ftmp%3A%2Fvar%2Flib%2Fdocker%2Ftmp%3Arw&forcerm=true'

→ The volumes array is not stringified, and this causes Docker (balenaEngine) to produce the HTTP 500 server error quoted above.

This issue was originally reported by a balena CLI end user in balena-io/balena-cli/issues/2440 . The workaround is to downgrade and pin docker-modem to v3.0.0.

cc: @robertgzr

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions