Throw exception with "Route not found" when call dump() with Open Alpha D1

Dear all && team,

Hello. It seems that there is an issues with dump() function when use D1 Open Alpha database.


I’ve maked a control experiment. Steps to reproduce are easy:

  1. Use your already existed D1 database or just create two new empty D1 database, one is Open Alpha database, another is legacy alpha database.
  2. In the worker script, use the demo codes from https://developers.cloudflare.com/d1/platform/client-api/#await-dbdump
 const dump = await db.dump()
 return new Response(dump, {
     status: 200,
     headers: {
         'Content-Type': 'application/octet-stream'
     }
 });

  • With legacy alpha database, it will just work and get the correct ArrayBuffer result.

  • With Open Alpha database, it will throw the error by get the json text result as below:
    {"success":false,"error":"Route not found"}


Mmm… Does anyone have any ideas? Thanks :slight_smile:

1 Like

Okay, three months passed, when I check the newest document page, it show the informantion as below now:

This API only works on databases created during D1’s alpha period. Check which version your database uses with wrangler d1 info <DATABASE_NAME> .

Thanks all the same :slight_smile:

If you’re looking for a way to dump beta databases: GitHub - nora-soderlund/cloudflare-d1-backups: A package to dump a copy of your experimental D1 database through a worker.
Not ideal, but until its built in natively again it works.