Skip to main content
ArcBlock Community

BM9000 not connecting to DID space

Twelve
Support
did-spacesbugqualifiedresolvedrewarded

Hello team,

we are having issues with the BM9000 connecting to DID Space. Typically our users are able to call up sounds and songs that have saved to their space, but it seems like our connection has been broken as we can no longer do this..

It has been a while since we added any updates so I’m not sure what would have changed on our side to cause this issue.

Have there been any changes in the blocklet platform that may have caused this?

Appreciate any help on the matters.

Thank you!

11 replies

JianChao14 months ago(edited)

你好,无法连接 did spaces 的过程中,有什么明显的报错可以提供呢?比如运行日志,页面报错等等。

Twelve14 months ago

z1e4XATJSo1Y1jom17Uhj1SpKZ4LFmYSaHY

z1d5y4TyLECjNb6P9dE96BjAb2LjKhN75M9

Thanks. There’s no visible error on the page or console. Uploads say "saved successfully", and the files do appear in the user’s DID Space when we check manually.

The issue is that they don’t show up in the BM9000 UI anymore—specifically under the section that used to display uploaded sounds (labeled “Your Sounds”).

This was working before. Upload still succeeds. The app just isn’t fetching or displaying the uploaded files anymore.

So we’re not dealing with a connection failure—upload works. It looks more like a regression in the fetch/list behavior.

Any changes recently to how fileService.listFiles() works with folder paths or filters?

void14 months ago

here is the code for getting did space files for the user. this hasn't changed in 3-4 months and just suddenly stopped working.

import { ListObjectsCommand, GetObjectCommand, SpaceClient } from '@blocklet/did-space-js'; import { streamToString } from '@did-space/core'; import type { Request, Response } from 'express';

import { authService, wallet } from '../../libs/auth'; import path from 'path'; import fs from 'fs';

export default async function $get(req: Request, res: Response) {

const isProduction = process.env.NODE_ENV === 'production' || process.env.ABT_NODE_SERVICE_ENV === 'production';

const staticDir = isProduction ? path.resolve(process.env.BLOCKLET_APP_DIR!, 'dist') : path.resolve(process.env.BLOCKLET_APP_DIR!, 'public');

let presetBeats = [ { key: "/songs/test.json", metadata: { contentType: 'application/json', objectType: 'beat', isPreset: true, }, name: "test.json" }, { key: "/songs/electro.json", metadata: { contentType: 'application/json', objectType: 'beat', isPreset: true, }, name: "electro.json" }, { key: "/songs/posse up.json", metadata: { contentType: 'application/json', objectType: 'beat', isPreset: true, }, name: "posse up.json" }, ];

let user: any = { didSpace: {} }; if (req.user?.did) {

let didUser = await authService.getUser(req.user?.did as string); user = didUser.user; }

let spaceClient = user?.didSpace?.endpoint ? new SpaceClient({ wallet, endpoint: user.didSpace.endpoint }) : null;

let output; let presetOutput;

if (req.query.beat && !req.query.preloaded) { let key = req.query.beat as string; output = await spaceClient!.send( new GetObjectCommand({ key, }), ); } else if (req.query.beat && req.query.preloaded) { let key = req.query.beat as string; let beat = presetBeats.find((beat) => beat.key === key); // load JSON from the static directory if (beat) { const filePath = path.join(staticDir, key); presetOutput = JSON.parse(fs.readFileSync(filePath, 'utf8')); } } else if (!req.query.beat && !req.query.preloaded) { output = await spaceClient!.send( new ListObjectsCommand(user.didSpace.endpoint), ); } else if (!req.query.beat && req.query.preloaded) { presetOutput = presetBeats; }

if (output && output.statusCode === 200) { if (req.query.beat) { return res.json({ beat: JSON.parse(await streamToString(output.data)) }); } else { let filteredBeats = output.data.filter((beat: any) => beat.metadata.objectType === 'beat');

return res.json({ beats: filteredBeats, presetBeats }); } }

if (output && output.statusCode === 404) { return res.json({ beats: [] }); }

if (presetOutput) { if (req.query.beat) { return res.json({ beat: presetOutput }); } else { return res.json({ presetBeats: presetOutput }); } }

if (output && output.statusCode === 404) { return res.json({ beats: [] }); }

return output ? res.status(output.statusCode).send(output.statusMessage) : res.status(500).send('Internal Server Error'); }

wangshijun14 months ago

Hi there! We wanted to let you know that there was a service outage when you reported the issue. We've since made some improvements to enhance our service reliability. Could you please check and let us know if you're still experiencing any problems? Thanks so much!

void14 months ago

hey z1VV21NqNWkiadznN32ALkos5dQqQwnCMty still receiving empty responses when trying to retrieve file lists from the space.

Screenshot 2025-07-25 at 3.35.23 PM.png

Screenshot 2025-07-25 at 3.35.17 PM.png

void14 months ago

i attached the screenshot because that might be an issue, not as evidence hahah. our app just returns empty list of files every time.

JianChao14 months ago(edited)

你好,请问一下你的 @blocklet/did-space-js 版本是多少,你可以升级到最新版本试试? cc z1notyEjWxWTWj1pUANTyPXV4hd2sZX1hzZ 然后代码可以修改为:

javascriptCopy
output = await spaceClient!.send(
  new ListObjectsCommand({key: '/' }),
);
void14 months ago

thanks, that fixed it.

is there any way to track updates like this so we can update before it breaks?

thanks again.

JianChao14 months ago

据我所知,ListObjectsCommand(user.didSpace.endpoint) 从来都不是正确的用法。ListObjectsCommand 必须接收一个参数,所有的 Command 接收的参数都是一个对象。

JianChao14 months ago

你可以提供一下你出现问题的 @blocklet/did-space-js 版本号吗?

Twelve14 months ago

hello z1VV21NqNWkiadznN32ALkos5dQqQwnCMty just checking to see if there are any updates on our issue.

Reply