Skip to content

parsing error on centos platform #2488

Closed
@rootmout

Description

@rootmout

Describe the bug

In a centos environment, the jq binary installed from dnf does not work in the same way as the one downloaded directly from github 1.6 releases page

To Reproduce

ℹ️ the dockerfile used is at the end of this issue.

user@laptop:~/$ podman run rootmout/debub-jq-parsing-error-in-centos:v1.0.0 cat entry_file.txt 
I am not a jsonee line
{"code":200,"message":"I am a json line","stack":"","level":"info"}
user@laptop:~/$ podman run rootmout/debub-jq-parsing-error-in-centos:v1.0.0 jq --version
jq-1.6
user@laptop:~/$ podman run rootmout/debub-jq-parsing-error-in-centos:v1.0.0 jq -R 'fromjson' entry_file.txt
jq: error (at entry_file.txt:1): Invalid numeric literal at line 1, column 2 (while parsing 'I am not a jsonee line')
jq: error (at entry_file.txt:2): Invalid numeric literal at line 1, column 12 (while parsing '{"code":200,"message":"I am a json line","stack":"","level":"info"}')
user@laptop:~/$ podman run rootmout/debub-jq-parsing-error-in-centos:v1.0.0 ./jq-linux64 --version
jq-1.6
user@laptop:~/$ podman run rootmout/debub-jq-parsing-error-in-centos:v1.0.0 ./jq-linux64 -R 'fromjson' entry_file.txt
jq: error (at entry_file.txt:1): Invalid numeric literal at line 1, column 2 (while parsing 'I am not a jsonee line')
{
  "code": 200,
  "message": "I am a json line",
  "stack": "",
  "level": "info"
}

rootmout/debub-jq-parsing-error-in-centos:v1.0.0 contain the binary jq installed by dnf and the ./jq-linux64 installed with wget from github, both are in version 1.6 and use the same file as entry but one installed by dnf fail with a parsing error while other is working fine.

Expected behavior

Both binary should work the same way.

Environment (please complete the following information):

  • OS and Version: CentOS Stream release 8
  • jq version: 1.6

Additional doc

Dockerfile used to create debub-jq-parsing-error-in-centos:v1.0.0 image used in "To Reproduce" section:

FROM quay.io/centos/centos:stream8

RUN dnf -y update -d 10 && \
    dnf -y --nodocs install wget vim jq && \
    dnf clean all

RUN wget https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64

RUN chmod +x jq-linux64

RUN echo -e \
  'I am not a json line\n{"code":200,"message":"I am a json line","stack":"","level":"info"}' \
  > entry_file.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions