firefly-iii/firefly-iii · error · FireflyException

200002

200002

Error message

200002: File is empty (zero bytes).

What it means

Error "200002: File is empty (zero bytes)." thrown in firefly-iii/firefly-iii.

Source

Thrown at app/Api/V1/Controllers/Models/Attachment/ShowController.php:92

     * @throws FireflyException
     */
    public function download(Attachment $attachment): LaravelResponse
    {
        if (true === auth()->user()->hasRole('demo')) {
            Log::channel('audit')->warning(sprintf('Demo user tries to access attachment API in %s', __METHOD__));

            throw new NotFoundHttpException();
        }
        if (false === $attachment->uploaded) {
            throw new FireflyException('200000: File has not been uploaded (yet).');
        }
        if (0 === $attachment->size) {
            throw new FireflyException('200000: File has not been uploaded (yet).');
        }
        if ($this->repository->exists($attachment)) {
            $content  = $this->repository->getContent($attachment);
            if ('' === $content) {
                throw new FireflyException('200002: File is empty (zero bytes).');
            }
            $quoted   = sprintf('"%s"', addcslashes(basename($attachment->filename), '"\\'));

            /** @var LaravelResponse $response */
            $response = response($content);
            $response
                ->header('Content-Description', 'File Transfer')
                ->header('Content-Type', 'application/octet-stream')
                ->header('Content-Disposition', 'attachment; filename='.$quoted)
                ->header('Content-Transfer-Encoding', 'binary')
                ->header('Connection', 'Keep-Alive')
                ->header('Expires', '0')
                ->header('Cache-Control', 'must-revalidate, post-check=0, pre-check=0')
                ->header('Pragma', 'public')
                ->header('Content-Length', (string) strlen($content))
            ;

            return $response;

View on GitHub (pinned to fd8791d08d)

When it happens

Trigger: Thrown at app/Api/V1/Controllers/Models/Attachment/ShowController.php:92 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of firefly-iii/firefly-iii@fd8791d08d (2026-08-17). Data as JSON: /api/errors/06ebd10b10ee1b91. Report an issue: GitHub.