octobercms/october · error · ApplicationException

Unable to find file, it may no longer exist

Error message

Unable to find file, it may no longer exist

What it means

Thrown by FileUpload::onLoadAttachmentConfig when getFileRecord() returns null — the attachment record being configured (title/description editing popup) no longer exists in the database, typically because it was deleted or the relation was detached in another session.

Solutions

  1. Reload the form/list so the file widget reflects the current attachments
  2. Re-upload the file if it was deleted but still referenced in the UI
  3. Check for concurrent edits that removed the attachment record
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at modules/backend/formwidgets/FileUpload.php:416 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/c4d5de7eebd50df0. Report an issue: GitHub.

Appendix: source

Thrown at modules/backend/formwidgets/FileUpload.php:416

            ;

            $ids = array_intersect($ids, $relationIds);

            if ($ids) {
                $this->getRelationModel()->setSortableOrder($ids, $orders);
            }
        }
    }

    /**
     * onLoadAttachmentConfig loads the configuration form for an attachment,
     * allowing title and description to be set
     */
    public function onLoadAttachmentConfig()
    {
        $file = $this->getFileRecord();
        if (!$file) {
            throw new ApplicationException('Unable to find file, it may no longer exist');
        }

        $file = $this->decorateFileAttributes($file);

        $this->vars['file'] = $file;
        $this->vars['displayMode'] = $this->getDisplayMode();
        $this->vars['cssDimensions'] = $this->getCssDimensions();
        $this->vars['configFormWidget'] = $this->getConfigFormWidget();

        return $this->makePartial('config_form');
    }

    /**
     * onSaveAttachmentConfig commits the changes of the attachment configuration form
     */
    public function onSaveAttachmentConfig()
    {
        try {

View on GitHub (pinned to b608633a7e)