{"action":"opened","issue":{"url":"https://api.github.com/repos/yandex/ClickHouse/issues/5803","repository_url":"https://api.github.com/repos/yandex/ClickHouse","labels_url":"https://api.github.com/repos/yandex/ClickHouse/issues/5803/labels{/name}","comments_url":"https://api.github.com/repos/yandex/ClickHouse/issues/5803/comments","events_url":"https://api.github.com/repos/yandex/ClickHouse/issues/5803/events","html_url":"https://github.com/yandex/ClickHouse/issues/5803","id":462376512,"node_id":"MDU6SXNzdWU0NjIzNzY1MTI=","number":5803,"title":"Updating External Dict (cache layout) through HTTPS with Basic Auth","user":{"login":"AlexFridman","id":8332918,"node_id":"MDQ6VXNlcjgzMzI5MTg=","avatar_url":"https://avatars2.githubusercontent.com/u/8332918?v=4","gravatar_id":"","url":"https://api.github.com/users/AlexFridman","html_url":"https://github.com/AlexFridman","followers_url":"https://api.github.com/users/AlexFridman/followers","following_url":"https://api.github.com/users/AlexFridman/following{/other_user}","gists_url":"https://api.github.com/users/AlexFridman/gists{/gist_id}","starred_url":"https://api.github.com/users/AlexFridman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AlexFridman/subscriptions","organizations_url":"https://api.github.com/users/AlexFridman/orgs","repos_url":"https://api.github.com/users/AlexFridman/repos","events_url":"https://api.github.com/users/AlexFridman/events{/privacy}","received_events_url":"https://api.github.com/users/AlexFridman/received_events","type":"User","site_admin":false},"labels":[{"id":386401505,"node_id":"MDU6TGFiZWwzODY0MDE1MDU=","url":"https://api.github.com/repos/yandex/ClickHouse/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-06-30T07:28:09Z","updated_at":"2019-06-30T07:28:09Z","closed_at":null,"author_association":"NONE","body":"**Describe the bug**\r\nI have an External Dict with a cached layout.\r\nDict source is HTTPS.\r\nSource HTTP server accepts Basic Auth (putted into URL)\r\n\r\n1. CH successfully reads whole dict via GET request.\r\n2. CH fails to authenticate when request some certain keys via POST request.\r\n\r\nDict config\r\n`<yandex>\r\n    <dictionary>\r\n        <name>taxonomy</name>\r\n        <lifetime>300</lifetime>\r\n        <source>\r\n            <http>\r\n                <url>https://user:pass@api.company/api/v1/data</url>\r\n                <format>JSONEachRow</format>\r\n            </http>\r\n        </source>\r\n        <layout>\r\n            <cache>\r\n                <size_in_cells>100000</size_in_cells>\r\n            </cache>\r\n        </layout>\r\n        <structure>\r\n            <id>\r\n                <name>category_id_hash</name>\r\n            </id>\r\n            <attribute>\r\n                <name>category_id</name>\r\n                <type>String</type>\r\n                <injective>true</injective>\r\n                <null_value></null_value>\r\n            </attribute>\r\n            <attribute>\r\n                <name>name</name>\r\n                <type>String</type>\r\n                <injective>false</injective>\r\n                <null_value></null_value>\r\n            </attribute>\r\n        </structure>\r\n    </dictionary>\r\n</yandex>`\r\n\r\n**How to reproduce**\r\n* Which ClickHouse server version to use\r\n19.7.3.1\r\n\r\n\r\n\r\n**Error message and/or stacktrace**\r\n`2019.06.30 07:25:42.816861 [ 40 ] {789fe354-591e-477d-870f-f5fb396a33c1} <Error> executeQuery: Code: 86, e.displayText() = DB::Exception: Received error from remote server /api/v0/cluster_builder/taxonomy_categories.\r\n HTTP status code: 401 Unauthorized, body: <html>\r\n<head><title>401 Authorization Required</title></head>\r\n<body bgcolor=\"white\">\r\n<center><h1>401 Authorization Required</h1></center>\r\n<hr><center>nginx/1.10.3 (Ubuntu)</center>\r\n</body>\r\n</html>\r\n (version 19.7.3.1) (from 18.214.36.203:42396) (in query: select dictGetString('taxonomy', 'name', 11111111111111111415) FORMAT TabSeparatedWithNamesAndTypes;), Stack trace:\r\n\r\n0. clickhouse-server(StackTrace::StackTrace()+0x16) [0x6834a66]\r\n1. clickhouse-server(DB::Exception::Exception(std::string const&, int)+0x1f) [0x317311f]\r\n2. clickhouse-server(DB::receiveResponse(Poco::Net::HTTPClientSession&, Poco::Net::HTTPRequest const&, Poco::Net::HTTPResponse&)+0x160) [0x684aa50]\r\n3. clickhouse-server(std::_MakeUniq<DB::ReadWriteBufferFromHTTP>::__single_object std::make_unique<DB::ReadWriteBufferFromHTTP, Poco::URI&, std::string const&, std::function<void (std::ostream&)>&, DB::ConnectionTime\r\nouts&>(Poco::URI&, std::string const&, std::function<void (std::ostream&)>&, DB::ConnectionTimeouts&)+0x2f4) [0x54ca574]\r\n4. clickhouse-server(DB::HTTPDictionarySource::loadIds(std::vector<unsigned long, std::allocator<unsigned long> > const&)+0xbe) [0x54c529e]\r\n5. clickhouse-server(DB::CacheDictionary::getString(std::string const&, DB::PODArray<unsigned long, 4096ul, AllocatorWithHint<false, AllocatorHints::DefaultHint, 67108864ul>, 15ul, 16ul> const&, DB::ColumnString*) co\r\nnst+0x8ee) [0x4d1032e]\r\n6. clickhouse-server(bool DB::FunctionDictGetString::executeDispatch<DB::CacheDictionary>(DB::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, DB::IDictionaryBase const*)+0x10\r\n4) [0x35077b4]\r\n7. clickhouse-server(DB::FunctionDictGetString::executeImpl(DB::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long)+0x14e) [0x351a49e]\r\n8. clickhouse-server(DB::PreparedFunctionImpl::defaultImplementationForConstantArguments(DB::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool)+0x49f) [0x62\r\nad24f]\r\n9. clickhouse-server(DB::PreparedFunctionImpl::executeWithoutLowCardinalityColumns(DB::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool)+0x35) [0x62ad925]\r\n10. clickhouse-server(DB::PreparedFunctionImpl::execute(DB::Block&, std::vector<unsigned long, std::allocator<unsigned long> > const&, unsigned long, unsigned long, bool)+0x378) [0x62adfc8]\r\n11. clickhouse-server(DB::ExpressionAction::prepare(DB::Block&, DB::Settings const&)+0x707) [0x6446b07]\r\n12. clickhouse-server(DB::ExpressionActions::addImpl(DB::ExpressionAction, std::vector<std::string, std::allocator<std::string> >&)+0xf5) [0x6447b75]\r\n13. clickhouse-server(DB::ExpressionActions::add(DB::ExpressionAction const&, std::vector<std::string, std::allocator<std::string> >&)+0x32) [0x6448312]\r\n14. clickhouse-server(DB::ScopeStack::addAction(DB::ExpressionAction const&)+0xa1) [0x6519211]\r\n15. clickhouse-server(DB::ActionsVisitor::visit(std::shared_ptr<DB::IAST> const&)+0x19be) [0x651d0ae]\r\n16. clickhouse-server(DB::ActionsVisitor::visit(std::shared_ptr<DB::IAST> const&)+0xcfa) [0x651c3ea]\r\n17. clickhouse-server(DB::ExpressionAnalyzer::getRootActions(std::shared_ptr<DB::IAST> const&, bool, std::shared_ptr<DB::ExpressionActions>&, bool)+0xbf) [0x645321f]\r\n18. clickhouse-server(DB::ExpressionAnalyzer::appendSelect(DB::ExpressionActionsChain&, bool)+0x74) [0x64544a4]\r\n19. clickhouse-server(DB::InterpreterSelectQuery::analyzeExpressions(DB::QueryProcessingStage::Enum, bool, std::shared_ptr<DB::FilterInfo> const&)+0x6e8) [0x5eb11b8]\r\n20. clickhouse-server(DB::InterpreterSelectQuery::executeImpl(DB::InterpreterSelectQuery::Pipeline&, std::shared_ptr<DB::IBlockInputStream> const&, bool)+0x1287) [0x5eb3bf7]\r\n21. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, std::shared_ptr<DB::IBlockInputStream> const&, std::shared_ptr<DB::IStorage> const&, DB::\r\nSelectQueryOptions const&, std::vector<std::string, std::allocator<std::string> > const&)+0x81c) [0x5eb513c]\r\n22. clickhouse-server(DB::InterpreterSelectQuery::InterpreterSelectQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::string, std::allocator<std::string> > con\r\nst&)+0x3b) [0x5eb5d8b]\r\n23. clickhouse-server(DB::InterpreterSelectWithUnionQuery::InterpreterSelectWithUnionQuery(std::shared_ptr<DB::IAST> const&, DB::Context const&, DB::SelectQueryOptions const&, std::vector<std::string, std::allocator<\r\nstd::string> > const&)+0x78b) [0x5ec208b]\r\n24. clickhouse-server(DB::InterpreterFactory::get(std::shared_ptr<DB::IAST>&, DB::Context&, DB::QueryProcessingStage::Enum)+0x16a) [0x5e9aa2a]\r\n25. clickhouse-server() [0x5fc42a1]\r\n26. clickhouse-server(DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, DB::Context&, std::function<void (std::string const&)>, std::function<void (std::string const&)>)+0x11e) [0x5fc47de]\r\n27. clickhouse-server(DB::HTTPHandler::processQuery(Poco::Net::HTTPServerRequest&, HTMLForm&, Poco::Net::HTTPServerResponse&, DB::HTTPHandler::Output&)+0x1ca8) [0x3186548]\r\n28. clickhouse-server(DB::HTTPHandler::handleRequest(Poco::Net::HTTPServerRequest&, Poco::Net::HTTPServerResponse&)+0x458) [0x3188af8]\r\n29. clickhouse-server(Poco::Net::HTTPServerConnection::run()+0x2a9) [0x6a7aec9]\r\n30. clickhouse-server(Poco::Net::TCPServerConnection::start()+0xf) [0x6a75e9f]\r\n31. clickhouse-server(Poco::Net::TCPServerDispatcher::run()+0xe5) [0x6a76585]`"}}
{"actor":{"display_login":"AlexFridman"}}