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

Error when creating a new user if name, last name, or email fields exceed 100 characters. #27725

Closed
AndreyDotcms opened this issue Feb 26, 2024 · 5 comments · Fixed by #28148 or #28349
Closed

Comments

@AndreyDotcms
Copy link
Contributor

AndreyDotcms commented Feb 26, 2024

Parent Issue

No response

Problem Statement

image

Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(100) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676) ~[postgresql-42.5.1.jar:42.5.1] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366) ~[postgresql-42.5.1.jar:42.5.1] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356) ~[postgresql-42.5.1.jar:42.5.1] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496) ~[postgresql-42.5.1.jar:42.5.1] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413) ~[postgresql-42.5.1.jar:42.5.1] at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190) ~[postgresql-42.5.1.jar:42.5.1] at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:177) ~[postgresql-42.5.1.jar:42.5.1] at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44) ~[HikariCP-3.4.2.jar:?] at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java) ~[HikariCP-3.4.2.jar:?] at com.dotmarketing.common.db.DotConnect.executeQuery(DotConnect.java:676) ~[classes/:?] at com.dotmarketing.common.db.DotConnect.executeQuery(DotConnect.java:599) ~[classes/:?] at com.dotmarketing.common.db.DotConnect.loadResult(DotConnect.java:307) ~[classes/:?] ... 94 more

Steps to Reproduce

1- Create a new user
2- Add more than 100 characters in any of the following fields: First Name, Last Name, or email
3- Get SQL log error

Acceptance Criteria

Sql errors should not be visible to the user.
Add limit validation in the back-end (API). Additionally, we should catch the error and display a clear log error message.

dotCMS Version

Master

Proposed Objective

Customer Support

Proposed Priority

Priority 3 - Average

External Links... Slack Conversations, Support Tickets, Figma Designs, etc.

No response

Assumptions & Initiation Needs

No response

Quality Assurance Notes & Workarounds

No response

Sub-Tasks & Estimates

No response

@erickgonzalez
Copy link
Contributor

The SQL error has been fixed and it no longer appears. Additionally, the error message is now very clear and easy to understand.

Screenshot 2024-04-19 at 11 13 49 AM

@bryanboza
Copy link
Member

We need some work here:

  • Now we have the validation for those fields, but we still having the same problems with the middleName, nickName, birthday field
    Image

  • We need add postman test to verify this validations in every field

@dsolistorres
Copy link
Contributor

Internal QA approved:
The middleName, nickName, and birthday fields are now validated with the 100 character limit

@bryanboza
Copy link
Member

Problems to import the postman collection

Image

Need to check the correct format...

@bryanboza bryanboza added Release : 24.05.13 Bug Fixing Release : 24.05.20 Bug- Fixing and removed Release : 24.05.13 Bug Fixing labels May 10, 2024
bryanboza added a commit that referenced this issue May 14, 2024
Signed-off-by: bryanboza <bryan.bozacastillo@dotcms.com>
github-merge-queue bot pushed a commit that referenced this issue May 17, 2024
#28547)

…issue-#27725

### Proposed Changes
- Add documentation
- Group request into collections 
- Reuse validations 

### Checklist
- [x] Tests


### Additional Info
** any additional useful context or info **

### Screenshots
Original             |  Updated
:-------------------------:|:-------------------------:
** original screenshot **  |  ** updated screenshot **

---------

Signed-off-by: bryanboza <bryan.bozacastillo@dotcms.com>
@bryanboza
Copy link
Member

Fixed, tested on the latest trunk // Docker // FF

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