I’m glad to see that the B2 team has also noticed this issue.
Here’s my temporary solution:
I commented out all the configurations related to S3 in app.yml
and successfully rebuilt Discourse. This does not affect access to previously uploaded files on my site, and any attachments uploaded during this period will be stored locally without causing any issues.
btw, I still wondering, why not add an option to keep the assets on the Discourse core server (I mean, without storing them on S3?