Easy to reproduce. The same happens with AzureQueue.
CREATE TABLE t0 (c0 Int) ENGINE = S3Queue('...minio bucket.../file0/', 'user', 'password', CSV) SETTINGS mode = 'unordered';
DETACH TABLE t0 SYNC;
ATTACH TABLE t0; --Logical Error
<Fatal> : Logical error: 'Table with storage id default.t0 (15bcb0e8-3a50-41d0-bc39-4de4201c87f9) already registered'.
<Fatal> : Stack trace (when copying this message, always include the lines below):
0. contrib/llvm-project/libcxx/include/__exception/exception.h:113: Poco::Exception::Exception(String const&, int) @ 0x00000000265358f2
1. src/Common/Exception.cpp:115: DB::Exception::Exception(DB::Exception::MessageMasked&&, int, bool) @ 0x0000000014076fe6
2. src/Common/Exception.h:119: DB::Exception::Exception(PreformattedMessage&&, int) @ 0x000000000cd6a5ac
3. src/Common/Exception.h:137: DB::Exception::Exception<String>(int, FormatStringHelperImpl<std::type_identity<String>::type>, String&&) @ 0x000000000cd6a236
4. src/Storages/ObjectStorageQueue/ObjectStorageQueueMetadataFactory.cpp:37: DB::ObjectStorageQueueFactory::registerTable(DB::StorageID const&) @ 0x000000001e29d767
5. src/Storages/ObjectStorageQueue/StorageObjectStorageQueue.cpp:267: DB::StorageObjectStorageQueue::startup() @ 0x000000001e3287ef
6. src/Interpreters/InterpreterCreateQuery.cpp:2039: DB::InterpreterCreateQuery::doCreateTable(DB::ASTCreateQuery&, DB::InterpreterCreateQuery::TableProperties const&, std::unique_ptr<DB::DDLGuard, std::default_delete<DB::DDLGuard>>&, DB::LoadingStrictnessLevel) @ 0x000000001aee5a7d
7. src/Interpreters/InterpreterCreateQuery.cpp:1752: DB::InterpreterCreateQuery::createTable(DB::ASTCreateQuery&) @ 0x000000001aede7ac
8. src/Interpreters/InterpreterCreateQuery.cpp:2362: DB::InterpreterCreateQuery::execute() @ 0x000000001aeeb592
9. src/Interpreters/executeQuery.cpp:1561: DB::executeQueryImpl(char const*, char const*, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum, DB::ReadBuffer*, std::shared_ptr<DB::IAST>&, std::shared_ptr<DB::ImplicitTransactionControlExecutor>) @ 0x000000001b27b243
10. src/Interpreters/executeQuery.cpp:1769: DB::executeQuery(String const&, std::shared_ptr<DB::Context>, DB::QueryFlags, DB::QueryProcessingStage::Enum) @ 0x000000001b2751bb
11. src/Server/TCPHandler.cpp:723: DB::TCPHandler::runImpl() @ 0x000000001e4fb492
12. src/Server/TCPHandler.cpp:2724: DB::TCPHandler::run() @ 0x000000001e514c24
13. base/poco/Net/src/TCPServerConnection.cpp:40: Poco::Net::TCPServerConnection::start() @ 0x00000000265eb9c7
14. base/poco/Net/src/TCPServerDispatcher.cpp:115: Poco::Net::TCPServerDispatcher::run() @ 0x00000000265ebfa5
15. base/poco/Foundation/src/ThreadPool.cpp:205: Poco::PooledThread::run() @ 0x000000002658b93f
16. base/poco/Foundation/src/Thread_POSIX.cpp:341: Poco::ThreadImpl::runnableEntry(void*) @ 0x0000000026589011
17. start_thread @ 0x00000000000a27f1
18. __clone3 @ 0x0000000000133c9c
Describe the bug
Easy to reproduce. The same happens with AzureQueue.
How to reproduce
Run:
Error message and/or stacktrace
Stack trace: