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

remote_url_allow_hosts is checked on very late stage, probably after schema inference #35064

Closed
den-crane opened this issue Mar 4, 2022 · 1 comment · Fixed by #35619
Closed
Assignees
Labels
bug Confirmed user-visible misbehaviour in official release

Comments

@den-crane
Copy link
Contributor

den-crane commented Mar 4, 2022

cat /etc/clickhouse-server/config.d/url.xml
<?xml version="1.0"?>
<yandex>
	<remote_url_allow_hosts></remote_url_allow_hosts>
</yandex>
select * from url('http://google.com', 'TSVRaw');

0 rows in set. Elapsed: 44.475 sec.

Received exception from server (version 22.2.1):
Code: 491. DB::Exception: Received from localhost:9000. DB::Exception:
 URL "http://www.google.com/" is not allowed in configuration file, see <remote_url_allow_hosts>. (UNACCEPTABLE_URL)


select * from url('http://google.com', 'TSVRaw', 'S String');
Elapsed: 0.015 sec.

Received exception from server (version 22.2.1):
Code: 491. DB::Exception: Received from localhost:9000. DB::Exception:
 URL "http://google.com" is not allowed in configuration file, see <remote_url_allow_hosts>. (UNACCEPTABLE_URL)
@alexey-milovidov alexey-milovidov added bug Confirmed user-visible misbehaviour in official release and removed unexpected behaviour labels Mar 5, 2022
@den-crane
Copy link
Contributor Author

remote_url_allow_hosts restricts remote , url , S3, HDFS, DICTIONARY with HTTP source

but not mysql / postgresql / ( I did not check odbc/ Mongodb / Redis / Cassandra )

select * from url('http://127.0.0.1', 'TSVRaw', 'S String');
DB::Exception: URL "http://127.0.0.1" is not allowed in configuration file, see <remote_url_allow_hosts>. (UNACCEPTABLE_URL)



select * from mysql('127.0.0.1:3306', 'dw', 'test', 'u', '123');
Ok.
0 rows in set. Elapsed: 0.019 sec.




SELECT *
FROM mysql('127.0.0.1:9004', 'system', 'one', 'default', '')

Received exception from server (version 22.2.1):
Code: 1000. DB::Exception: Received from localhost:9000. DB::Exception: mysqlxx::BadQuery: Code: 47. DB::Exception: Missing columns: 'TABLE_SCHEMA'

and in config.xml it states <!-- Host should be specified exactly as in URL. The name is checked before DNS resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Confirmed user-visible misbehaviour in official release
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants