Skip to content

POST /apps/text/attachments returns 500 on PostgreSQL in Collectives read-only view (empty documentId) #9591

Closed as duplicate

Description

@Swisstraxx

Describe the bug
In a Collectives page, an inserted PNG image is displayed in edit mode but not in view (read-only) mode. The image placeholder shows "Request failed with status code 500".

The failing request is POST /apps/text/attachments (AttachmentController::getAttachmentList). It is sent without session data (documentId and sessionToken are empty strings, sessionId is 0). PostgreSQL rejects the empty string for a bigint column, which results in the 500 error.

To Reproduce
Steps to reproduce the behavior:

  1. Open a page in a Collective and switch to edit mode.
  2. Paste or insert a PNG image. It is displayed correctly.
  3. Leave edit mode and open the page in view mode.
  4. The image is not displayed, the request POST /apps/text/attachments returns 500.

Expected behavior
The image is displayed in view mode as well. The attachments request should not run the session lookup with empty values.

Screenshots

Image

Server details:

  • Nextcloud version: 35.0.2.2 (Docker, nextcloud:35-apache)
  • PHP Version: 8.5.12
  • Database: PostgreSQL 17
  • Text app: 9.0.1
  • Collectives app: 4.8.0

Client details:

  • OS: Windows 11
  • Browser: Firefox
  • Browser version: 159
  • Device: desktop
Logs

Nextcloud log (data/nextcloud.log)

level 3, app index, POST /apps/text/attachments

An exception occurred while executing a query: SQLSTATE[22P02]:
Invalid text representation: 7 ERROR: invalid input syntax for
type bigint: ""

Query: SELECT * FROM oc_text_sessions
       WHERE document_id = ? AND id = ? AND token = ?
Params: ["", 0, ""]

Call chain:
SessionMapper::find
SessionService::getSession / getValidSession
SessionMiddleware::assertDocumentSession
AttachmentController::getAttachmentList

Browser log

POST https://<server>/apps/text/attachments
Status: 500 Internal Server Error
Content-Type of response: text/html

Activity

  1. added theissue type on Nov 10, 2026
  2. blizzz commented on Nov 10, 2026

    @blizzz
    Member

    Thanks for reporting! It is a duplicate of #9415 and fixed with #9443 for upcoming NC 35.0.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions