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

Truncate stack trace from error output #381

Open
3fonov opened this issue Nov 11, 2024 · 3 comments
Open

Truncate stack trace from error output #381

3fonov opened this issue Nov 11, 2024 · 3 comments
Labels
enhancement New feature or request

Comments

@3fonov
Copy link
Contributor

3fonov commented Nov 11, 2024

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

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.
@3fonov 3fonov added the enhancement New feature or request label Nov 11, 2024
@BentsiLeviav
Copy link
Contributor

Hi @3fonov

Thank you for your contribution.
The error appears in the first line of the stack trace so most of the time there is no need to scroll until you find it.
In addition, and most importantly, we use this stack trace to investigate things on the ClickHouse side, therefore, this suggestion is problematic.

Thanks again, we would love to get your help with other urgent issues.

@3fonov
Copy link
Contributor Author

3fonov commented Nov 11, 2024

@BentsiLeviav from my point of view at day to day work i have following output in model with errors:
image

And for me relevant only upper half of the output. Some times terminal window not so big and actual error hidden behind the fold. So stack trace in 99.9% of times is not relevant to me. Same thing made at dbt-bigquery adapter. Maybe we can introduce env variable HIDE_STACK_TRACE to hide stack trace?

@BentsiLeviav
Copy link
Contributor

BentsiLeviav commented Nov 11, 2024

Maybe we can introduce env variable HIDE_STACK_TRACE to hide stack trace

Sounds good. Let's disable it by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants