I've tried to run optimize using clickhouse-local :) 
```
#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007fb333cf3859 in __GI_abort () at abort.c:79
#2  0x0000000010e89c1c in Poco::SignalHandler::handleSignal (sig=11) at ../contrib/poco/Foundation/src/SignalHandler.cpp:94
#3  <signal handler called>
#4  DB::IVolume::getDisk (this=0x0) at ../src/Disks/IVolume.h:63
#5  DB::MergeTreeDataMergerMutator::mergePartsToTemporaryPart (this=<optimized out>, future_part=..., metadata_snapshot=..., merge_entry=..., time_of_merge=<optimized out>, context=..., 
    space_reservation=..., deduplicate=<optimized out>) at ../src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp:719
#6  0x000000000e0f07d9 in DB::StorageMergeTree::merge (this=<optimized out>, aggressive=<optimized out>, partition_id=..., final=<optimized out>, deduplicate=<optimized out>, 
    out_disable_reason=<optimized out>) at ../src/Storages/StorageMergeTree.cpp:746
#7  0x000000000e0f54fc in DB::StorageMergeTree::optimize (this=0x7fb33362f700, partition=..., final=<optimized out>, deduplicate=<optimized out>, context=...)
    at ../src/Storages/StorageMergeTree.cpp:1032
#8  0x000000000dbdd824 in DB::InterpreterOptimizeQuery::execute (this=0x7fb332e983e0) at ../src/Interpreters/InterpreterOptimizeQuery.cpp:30
#9  0x000000000dee5908 in DB::executeQueryImpl (begin=<optimized out>, end=<optimized out>, context=..., internal=<optimized out>, stage=<optimized out>, has_query_tail=<optimized out>, 
    istr=<optimized out>) at ../src/Interpreters/executeQuery.cpp:422
#10 0x000000000dee85a9 in DB::executeQuery(DB::ReadBuffer&, DB::WriteBuffer&, bool, DB::Context&, std::__1::function<void (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&, 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&)>) (istr=..., ostr=..., allow_into_outfile=false, context=..., set_result_details=...)
    at ../src/Interpreters/executeQuery.cpp:796
#11 0x0000000007c71ed0 in DB::LocalServer::processQueries (this=<optimized out>) at ../programs/local/LocalServer.cpp:361
#12 0x0000000007c6fee3 in DB::LocalServer::main (this=0x7fff1f995348) at ../programs/local/LocalServer.cpp:270
#13 0x0000000010d7b513 in Poco::Util::Application::run (this=0x7fff1f995348) at ../contrib/poco/Util/src/Application.cpp:334
#14 0x0000000007c75a8b in mainEntryClickHouseLocal (argc=8, argv=0x7fb332ee7680) at ../programs/local/LocalServer.cpp:597
#15 0x0000000007b87cbd in main (argc_=<optimized out>, argv_=<optimized out>) at ../programs/main.cpp:400
```

So it's from this line: 
https://github.com/ClickHouse/ClickHouse/blob/38c7132c0f580547a72e3cc1fa18a091abf46221/src/Storages/MergeTree/MergeTreeDataMergerMutator.cpp#L719
(getTemporaryVolume is nullptr)

Introduced https://github.com/ClickHouse/ClickHouse/pull/8750

registerDisks();
    
    if (config().has("macros"))
        context->setMacros(std::make_unique<Macros>(config(), "macros", log));
    
    
    context->setExternalAuthenticatorsConfig(config());
    setupUsers();
    
    
    context->getProcessList().setMaxSize(0);
    
    size_t uncompressed_cache_size = config().getUInt64("uncompressed_cache_size", 0);
    if (uncompressed_cache_size)
        context->setUncompressedCache(uncompressed_cache_size);
    
    
    size_t mark_cache_size = config().getUInt64("mark_cache_size", 5368709120);
    if (mark_cache_size)
        context->setMarkCache(mark_cache_size);
    
    context->setDefaultProfiles(config());
    /** Init dummy default DB
      * NOTE: We force using isolated default database to avoid conflicts with default database from server environment
      * Otherwise, metadata of temporary File(format, EXPLICIT_PATH) tables will pollute metadata/ directory;
      *  if such tables will not be dropped, clickhouse-server will not be able to load them due to security reasons.
      */
    std::string default_database = config().getString("default_database", "_local");
    DatabaseCatalog::instance().attachDatabase(default_database, std::make_shared<DatabaseMemory>(default_database, *context));
    context->setCurrentDatabase(default_database);