Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API excepts a longer filename than is excepted by the database #2948

Open
tiborrr opened this issue Jan 30, 2025 · 2 comments
Open

API excepts a longer filename than is excepted by the database #2948

tiborrr opened this issue Jan 30, 2025 · 2 comments
Labels
bug Something isn't working or in unexpected ways restserver Affects the rest server.

Comments

@tiborrr
Copy link
Contributor

tiborrr commented Jan 30, 2025

You can provide a string to filename longer than 254 characters. This problem should be handled by the API because currently you do not get any error if you provide this data.

docspell-restserver  | 2025.01.30 12:08:32:0000 [io-comp...] [ERROR] docspell.store.impl.DoobieLogging.run:30 - SQL exec failed: INSERT INTO job (jid, task, group_, args, subject, submitted, submitter, priority, state, retries, progress, tracker, worker, started, finished, startedmillis) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,? ) (List(Ident(REDACTED), Ident(process-item), Ident(1), {"meta":{"collective":1,"itemId":null,"language":"eng","direction":"incoming","sourceAbbrev":"webapp","folderId":null,"validFileTypes":[],"skipDuplicate":false,"fileFilter":"SOME_FILTER","tags":[],"reprocess":false,"attachmentsOnly":false,"customData":{"SOME_CUSTOM_DATA"}},"files":[{"name":"REALLY_LONGNAME","fileMetaId":{"collective":1,"category":"attachmentsource","id":"REDACTED"}}]}, REALLY_LONGNAME), Ident(REDACTED), High, Waiting, 0, 0, Some(Ident(REDACTED)), None, None, None, None))
docspell-restserver  | org.postgresql.util.PSQLException: ERROR: value too long for type character varying(254)
docspell-restserver  |  at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725)
docspell-restserver  |  at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412)
docspell-restserver  |  at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371)
docspell-restserver  |  at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:502)
docspell-restserver  |  at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:419)
docspell-restserver  |  at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)
docspell-restserver  |  at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:155)
docspell-restserver  |  at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
docspell-restserver  |  at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
docspell-restserver  |  at doobie.free.KleisliInterpreter$PreparedStatementInterpreter.$anonfun$executeUpdate$5(kleisliinterpreter.scala:909)
docspell-restserver  |  at doobie.free.KleisliInterpreter$PreparedStatementInterpreter.$anonfun$executeUpdate$5$adapted(kleisliinterpreter.scala:909)
docspell-restserver  |  at doobie.free.KleisliInterpreter.$anonfun$primitive$2(kleisliinterpreter.scala:107)
docspell-restserver  |  at flatMap @ fs2.Compiler$Target.flatMap(Compiler.scala:163)
docspell-restserver  |  at $anonfun$tailRecM$1 @ doobie.util.transactor$Transactor$$anon$4.$anonfun$apply$4(transactor.scala:165)
@eikek eikek added bug Something isn't working or in unexpected ways restserver Affects the rest server. labels Jan 30, 2025
@eikek
Copy link
Owner

eikek commented Jan 30, 2025

We can also remove the arbitrary file name limit imho on the db

@tiborrr
Copy link
Contributor Author

tiborrr commented Jan 31, 2025

Sounds good to me. I was not planning on exposing this API externally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or in unexpected ways restserver Affects the rest server.
Projects
None yet
Development

No branches or pull requests

2 participants