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

Remove stacktrace from database errors #382

Merged
merged 12 commits into from
Nov 13, 2024
Merged

Conversation

3fonov
Copy link
Contributor

@3fonov 3fonov commented Nov 11, 2024

Summary

I'm always frustrated when scrolling throw stack trace to my actual errors in database.

#381

Solution
Remove stack trace and keep only database errors.

Before

clickhouse adapter: ClickHouse server does not support exchange tables Database Error
  Code: 1.
  DB::Exception: System call renameat2() is not supported. Stack trace:
  
  0. DB::Exception::Exception(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) @ 0xce3f35a in /usr/bin/clickhouse
  1. DB::renameExchange(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&) @ 0x11a385a5 in /usr/bin/clickhouse
  2. DB::DatabaseAtomic::renameTable(std::__1::shared_ptr<DB::Context const>, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, DB::IDatabase&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, bool, bool) @ 0x11a2f0dd in /usr/bin/clickhouse
  3. DB::InterpreterRenameQuery::executeToTables(DB::ASTRenameQuery const&, std::__1::vector<DB::RenameDescription, std::__1::allocator<DB::RenameDescription> > const&, std::__1::map<DB::UniqueTableName, std::__1::unique_ptr<DB::DDLGuard, std::__1::default_delete<DB::DDLGuard> >, std::__1::less<DB::UniqueTableName>, std::__1::allocator<std::__1::pair<DB::UniqueTableName const, std::__1::unique_ptr<DB::DDLGuard, std::__1::default_delete<DB::DDLGuard> > > > >&) @ 0x125ca713 in /usr/bin/clickhouse
  4. DB::InterpreterRenameQuery::execute() @ 0x125c9608 in /usr/bin/clickhouse
  5. ? @ 0x1297956b in /usr/bin/clickhouse
  6. DB::executeQuery(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::shared_ptr<DB::Context>, bool, DB::QueryProcessingStage::Enum) @ 0x1297682d in /usr/bin/clickhouse
  7. DB::TCPHandler::runImpl() @ 0x1353d924 in /usr/bin/clickhouse
  8. DB::TCPHandler::run() @ 0x13551919 in /usr/bin/clickhouse
  9. Poco::Net::TCPServerConnection::start() @ 0x1636236f in /usr/bin/clickhouse
  10. Poco::Net::TCPServerDispatcher::run() @ 0x163646fb in /usr/bin/clickhouse
  11. Poco::PooledThread::run() @ 0x1651ff92 in /usr/bin/clickhouse
  12. Poco::ThreadImpl::runnableEntry(void*) @ 0x1651d71d in /usr/bin/clickhouse
  13. ? @ 0x7fd8e7797609 in ?
  14. clone @ 0x7fd8e76bc133 in ?

After

clickhouse adapter: ClickHouse server does not support exchange tables Database Error
  Code: 1.
  DB::Exception: System call renameat2() is not supported.

Checklist

Delete items not relevant to your PR:

  • Unit and integration tests covering the common scenarios were added
  • A human-readable description of the changes was provided to include in CHANGELOG
  • For significant changes, documentation in https://github.com/ClickHouse/clickhouse-docs was updated with further explanations or tutorials

@BentsiLeviav
Copy link
Contributor

Hi @3fonov

Thank you for your contribution!
I'm not sure this behavior would be desired, as we often use the stack trace to investigate CH side issues.

In addition, usually, the error appears right at the beginning of the stack trace, so in what case do you need to scroll to find it? You can just ignore the reset of the lines.

I understand that it might be frustrating for you to have irrelevant text, but it is crucial for many other users.

We would love to get your help with other critical issues in this repo.

Thank you again for your contribution.

@3fonov
Copy link
Contributor Author

3fonov commented Nov 11, 2024

@BentsiLeviav added ENV VAR to control behavior and corresponding tests.

@BentsiLeviav BentsiLeviav self-requested a review November 13, 2024 08:26
@BentsiLeviav
Copy link
Contributor

Could you please fix the lint issue?

@3fonov
Copy link
Contributor Author

3fonov commented Nov 13, 2024

Could you please fix the lint issue?

It seems that it is from file that i didn't touched: tests/integration/adapter/dictionary/test_dictionary.py. Fixed it anyway.

@BentsiLeviav
Copy link
Contributor

Ohh thanks for that!

@BentsiLeviav BentsiLeviav merged commit bd45c3c into ClickHouse:main Nov 13, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants