Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parsing error on centos platform #2488

Closed
rootmout opened this issue Sep 22, 2022 · 2 comments
Closed

parsing error on centos platform #2488

rootmout opened this issue Sep 22, 2022 · 2 comments
Labels

Comments

@rootmout
Copy link

rootmout commented Sep 22, 2022

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
@wader
Copy link
Member

wader commented Sep 22, 2022

Hi, i suspect it might have to do with #2400 and it seems like the author of that PR also has fixed it in redhats packaging of jq, see https://bugzilla.redhat.com/show_bug.cgi?id=2008983 and https://gitlab.com/redhat/centos-stream/rpms/jq/-/tree/c9s. But then wouldn't it be the other way around? dnf installed would work but 1.6 from release would fail? strange

@itchyny
Copy link
Contributor

itchyny commented Jun 28, 2023

This bug was fixed by #2400 (c4d39c4) on May 27, 2022.

@itchyny itchyny closed this as completed Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants