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

Missing newline in JSON stream from proxy API pin/ls #1885

Closed
StrathCole opened this issue Mar 9, 2023 · 0 comments · Fixed by #1893
Closed

Missing newline in JSON stream from proxy API pin/ls #1885

StrathCole opened this issue Mar 9, 2023 · 0 comments · Fixed by #1893
Labels
effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked

Comments

@StrathCole
Copy link
Contributor

Additional information:

  • OS: Linux
  • IPFS Cluster version: 1.0.6
  • Installation method: binary

Describe the bug:

When calling the proxy API for pin/ls on port 9095, the returned format is not a valid newline-separated JSON.
Entries are returned like:
curl -X POST "http://127.0.0.1:9095/api/v0/pin/ls?type=recursive&stream=true"

{"Cid":"QmRcYpbiapVNstWVWvLRgvkvWXm5zKHawMFy7cFpRYfMFz","Type":"recursive"}{"Cid":"QmcVrQjK7FLFzefChixfBdTaCqjdr5hPb5yp44m7NUti1m","Type":"recursive"}{"Cid":"QmUfyBTHzrdGCrnPnHf6Fxhw4CkFDUKSKNUW6PcjMUxdwh","Type":"recursive"}{"Cid":"QmWRnA8LATY96xK7kAL9mW7hoABHvNXSCcQmrtSUKmvLw5","Type":"recursive"}{"Cid":"QmeXqon4zfscwoRCeebCcMLRA7xrHM6bhF4xa8Fd5oZ9s5","Type":"recursive"}{"Cid":"QmTt3B3qe1PcjdVjNh7pWJb1hrotacNYoQn63aXcxS4JJJ","Type":"recursive"}

While the original API of the ipfs on port 5001 returns data like this:
curl -X POST "http://127.0.0.1:5001/api/v0/pin/ls?type=recursive&stream=true"

{"Cid":"QmRg2YqDzwUrCQYpcuU69YcJZ9X2j2WyixBRi1YVbzetcZ","Type":"recursive"}
{"Cid":"QmTVmr6QhX1kkZ7YYJR8qebxb5XdwfJNexwZTvXuiAWt7b","Type":"recursive"}
{"Cid":"QmVVZ9B3hyYgDHHQLr3b79nHd37udq3NfkxaUYiRV8vEm4","Type":"recursive"}
{"Cid":"QmdJmmC5iyU17vSduESHkiDG5SvPSy785papnKvdZRftSZ","Type":"recursive"}
{"Cid":"QmRxGPcA5SYk2bUYpkczGCM7uEVwY8YgNPD4cY4HG5HRXC","Type":"recursive"}
{"Cid":"QmQFVNxoJuwmRMQm1vYMCf2pRCr4AgcGGYxVjK5MyLyTbp","Type":"recursive"}
{"Cid":"QmQNQrmieaHzf2Pn3rr7x5qkzTgKB9r62JPhJXLhvmZTiF","Type":"recursive"}

It seams that this leads to problems with clients (e.g. webui) parsing the JSON stream.

@StrathCole StrathCole added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Mar 9, 2023
@hsanjuan hsanjuan added help wanted Seeking public contribution on this issue status/ready Ready to be worked P1 High: Likely tackled by core team if no one steps up good first issue Good issue for new contributors exp/beginner Can be confidently tackled by newcomers effort/hours Estimated to take one or several hours and removed need/triage Needs initial labeling and prioritization labels Mar 9, 2023
@hsanjuan hsanjuan added this to the Release v1.0.7 milestone Mar 9, 2023
@hsanjuan hsanjuan linked a pull request Mar 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours exp/beginner Can be confidently tackled by newcomers good first issue Good issue for new contributors help wanted Seeking public contribution on this issue kind/bug A bug in existing code (including security flaws) P1 High: Likely tackled by core team if no one steps up status/ready Ready to be worked
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants