appwrite: 🐛 Bug Report: Adding enums with length greater than before results in server error
👟 Reproduction steps
Make a collection in a database for and an Enum Attribute
paymentStatus
Attrib has
- 3 Enums:
Success
-Pending
-Failure
- if I edit this attribute and add
Intiated
this won’t work, becausemariaDB
has already taken the highest length ofPending
,Success
andFailure
that is 7
👍 Expected behavior
It should just add new data to the enum without an error
👎 Actual Behavior
This is the error it throws in the Appwrite container logs
This is the error it throws on Client or on server while trying to add Initiated
Enum to the attribute field
🎲 Appwrite version
Version 1.3.x
💻 Operating system
Linux
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn’t find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 3
- Comments: 25 (8 by maintainers)
i can reproduce. Set varchar(50) (or text…) on enum fields ?
@christyjacob4 Thank you for the reply 😃
Yes, I’ve updated as described by the Appwrite documentation, including executing the migration command and verifying that it did finish.
I didn’t update from the previous version but instead skipped a few smaller updates. However I didn’t skip any minor or major versions, so according to the docs this shouldn’t cause any problems.
Is there anything that I could provide that would help to debug this issue?
I updated my Appwrite instance after having this bug today. Even though your changelog states the issue was fixed with version 1.4.13, I still encounter the same issue. I updated the instance normally and did the migration as described in your documentation. Is there anything else I can do on my end?
I’m having this issue as well, on AppWrite 1.4.1
To be clear, the error doesn’t occur when adding a new Enum to the attribute list. The error occurs when adding a document that uses that Enum.
It seems to work like this:
Example error produced in appwrite error log for version 1.4.1:
Note the most useful part of this error, the message; “Data too long for column ‘status’ at row 1”, isn’t returned in the API response, thought the stack trace is. I’m not including any error message related to where a code resolution would be, as the code that needs resolved is the part that handles updating of the attribute, and doesn’t throw any error.
Hey everyone, I’ve been trying to reproduce this bug on the console and CLI (v1.3.8), and even on the
master
branch of the repo, with 0 success. So it looks like this issue is fixed?It’s because of this code
Possibilities
size
input on form to let user decideQuick fix : Edit field property on mariaDB to change max size
Ideal solution is to update table when update enum attribute, to let it transparent to user