IceWhaleTech/CasaOS · error
not support
Error message
not support
What it means
Dropbox driver's Copy operation is intentionally unimplemented: it returns a static error 'not support' instead of calling the Dropbox API. This is a driver capability gap, not a runtime/network failure. Any code path that tries to copy a file onto Dropbox will always fail with this error.
Source
Thrown at drivers/dropbox/drive.go:89
return "", err
}
logger.Info("resp", zap.Any("resp", string(resp)))
return user.Email, nil
}
func (d *Dropbox) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) error {
return nil
}
func (d *Dropbox) Move(ctx context.Context, srcObj, dstDir model.Obj) error {
return nil
}
func (d *Dropbox) Rename(ctx context.Context, srcObj model.Obj, newName string) error {
return nil
}
func (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
return errors.New("not support")
}
func (d *Dropbox) Remove(ctx context.Context, obj model.Obj) error {
return nil
}
func (d *Dropbox) Put(ctx context.Context, dstDir model.Obj, stream model.FileStreamer, up driver.UpdateProgress) error {
return nil
}
func (d *Dropbox) GetInfo(ctx context.Context) (string, string, string, error) {
return "", "", "", nil
}
var _ driver.Driver = (*Dropbox)(nil)
View on GitHub (pinned to 0d3b2f444e)
Solutions
- Disable/hide the copy action for the Dropbox driver in the frontend or caller (check the driver type before invoking Copy).
- Implement Copy using the Dropbox API 'files/copy_v2' endpoint (POST https://api.dropbox.com/2/files/copy_v2 with from_path and to_path).
- As a stopgap, emulate copy client-side: download the object with Get and re-upload it with Put into the destination directory.
Example fix
// before
func (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
return errors.New("not support")
}
// after
func (d *Dropbox) Copy(ctx context.Context, srcObj, dstDir model.Obj) error {
_, err := d.request("https://api.dropboxapi.com/2/files/copy_v2", http.MethodPost, func(req *resty.Request) {
req.SetBody(base.Json{
"from_path": srcObj.GetPath(),
"to_path": stdpath.Join(dstDir.GetPath(), srcObj.GetName()),
})
}, nil)
return err
} Defensive patterns
Strategy: validation
Validate before calling
// Skip copy for drivers that do not implement it
func CanCopy(d model.Driver) bool {
_, ok := d.(*dropbox.Dropbox)
return !ok
}
if !CanCopy(d) { return errors.New("copy is not supported on this storage") }
err := d.Copy(ctx, src, dst) Try / catch
if err := d.Copy(ctx, src, dst); err != nil {
if strings.Contains(err.Error(), "not support") {
// surface a user-facing 'unsupported operation' message, do not retry
return model.ErrUnsupported
}
return err
} Prevention
- Expose driver capability flags (supportsCopy) instead of failing at call time
- Hide copy UI actions for drivers with unimplemented operations
- Run a capability matrix test across all drivers in CI
When it happens
Trigger: Calling Dropbox.Copy(ctx, srcObj, dstDir) — e.g. a file-manager 'copy' action on a Dropbox mount. The method body is only 'return errors.New("not support")', so every invocation fails deterministically.
Common situations: A UI or API layer exposes copy for all storage drivers uniformly and the user copies a file on a Dropbox storage. Also triggered by batch/duplicate operations that fall through to Copy when the destination differs from the source.
Related errors
AI-assisted analysis of IceWhaleTech/CasaOS@0d3b2f444e (2026-08-15).
Data as JSON: /api/errors/0c660cd811b6e79c.
Report an issue: GitHub.