question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

JSON from private host addresses

See original GitHub issue

Issue Summary

New JSON data source does not allow use with private host addresses. I get the error: “Can’t query private addresses.”

If databases can be hosted on internal DNS names why couldn’t JSON data sources? Could this be made configurable?

Steps to Reproduce

  1. Install Redash via Docker, which is now recommended.
  2. Use JSON Data Source (new in v8 beta 2)
  3. Point to JSON file hosted on local computer.

On Docker the localhost URL will look like url: http://host.docker.internal:5001/mydata/my_data.json

Expected: As a developer I can view local JSON for testing new data sources or new application URLs. Actual: Error on the query screen, “Can’t query private addresses.”

Technical details:

  • Redash Version: 8.0 beta 2
  • Browser/OS: Chrome/Windows
  • How did you install Redash: Docker, updated docker-compose.yaml to redash/redash:8.0.0-beta.2.b29352

The error seems to come from: https://github.com/getredash/redash/blob/4c56900248834579374336d269000bb8cf34066c/redash/query_runner/json_ds.py#L180

Comments

I’ve tested a local copy of the container with this raise commented out, and everything works fine. I understand in PaaS or when Redash is externally visible, this is necessary to protect internal data sources. But I’m evaluating Redash to run inside my production cluster only accessible to internal users. A core use case is to surface data internal to the cluster (PostgreSql, MongoDB, JSON, and CSV) and control it via dashboard groups and permissions. If databases can be hosted on internal DNS names why couldn’t JSON data sources? Could this be made configurable?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arikfrcommented, Nov 13, 2019

Maybe, but it’s a really easy fix/change. A PR addressing this (in the way outlined above) is welcomed.

1reaction
arikfrcommented, Nov 13, 2019

@yzorg

but I also worry about turning off security features with obscure settings.

We can have proper documentation around it.

But the other option you suggested is fine as well. No need for env var, just have it in a separate file and we won’t enable it by default. The implementation can definitely be shared between the two – just add the needed configuration in the JSON one, and subclass it for the second.

Read more comments on GitHub >

github_iconTop Results From Across the Web

json-server cannot access via local IP - Stack Overflow
I found the solution for this issue: json-server --host 192.168.1.XXX my_file.json. Using this command, server is deployed on my local IP, ...
Read more >
Error running query: Can't query private addresses
Hi,. I am trying to call a PRTG API with built in authentication in the URL using the JSON Data Source. I have...
Read more >
AWS IP address ranges - AWS General Reference
Amazon Web Services (AWS) publishes its current IP address ranges in JSON format. To view the current ranges, download the .json file.
Read more >
symrest.json reference - IBM
When your Windows management hosts use private and public IP addresses, specifies the public IP address on which the SYMREST service must listen....
Read more >
Private Locations Configuration - Datadog Docs
The private locations configuration options can be then be passed as parameters to your JSON configuration file or as arguments in the launch...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found