CDR Tickets

Issue Number 4619
Summary [Admin] Unable to save account permission changes
Created 2019-05-17 12:59:05
Issue Type Task
Submitted By Osei-Poku, William (NIH/NCI) [C]
Assigned To Kline, Bob (NIH/NCI) [C]
Status Closed
Resolved 2020-04-10 15:47:13
Resolution Fixed
Path /home/bkline/backups/jira/ocecdr/issue.244285
Description

I am not able to save changes to permissions when I update an account using the admin interface. Sometimes, I get the following error message. 

A problem occurred in a Python script.

D:\cdr\Log\tmptcbwu7.html contains the description of this error.

Comment entered 2019-05-17 13:34:23 by Englisch, Volker (NIH/NCI) [C]

Error from logfile:

Traceback (most recent call last):
  File "D:\Inetpub\wwwroot\cgi-bin\cdr\EditUser.py", line 69, in <module>
    error = cdr.putUser(session, usrName, user)
  File "D:\cdr\Lib\Python\cdr.py", line 361, in putUser
    Session.User(session, **user_opts).save(user.password)
  File "D:\cdr\Lib\Python\cdrapi\users.py", line 1119, in save
    self.__save(password)
  File "D:\cdr\Lib\Python\cdrapi\users.py", line 1173, in __save
    self.session.cursor.execute(sql, tuple(values))
DataError: ('22001', '[22001] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]String or binary data would be truncated. (8152) (SQLExecDirectW); [01000] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]The statement has been terminated. (3621)')
Comment entered 2019-05-17 13:40:34 by Englisch, Volker (NIH/NCI) [C]

Since you're saying Sometimes could you please add a little more detail? Does sometimes refer to certain users or are you able to make changes to a user successfully at some point but the next time it fails or does it fail all the time or only when modifying certain permissions?
It appears the problem only comes up for users with a long username, maybe?

Comment entered 2019-05-17 13:50:11 by Osei-Poku, William (NIH/NCI) [C]

The error message is inconsistent and I have seen multiple error messages. The error messages come up when making the changes within the User's account but never show up when making the changes in the user groups. Other times, both of them work without a problem. A few minutes ago, I was able to successful make the change that produced the python script error message in the original comment above without seeing the error message.

Comment entered 2019-05-17 13:58:59 by Englisch, Volker (NIH/NCI) [C]

I have seen multiple error messages

Aren't you only seeing the message:

A problem occurred in a Python script.

D:\cdr\Log\tmptcbwu7.html contains the description of this error.

If you're seeing other messages please include those if you can.

Comment entered 2019-05-17 14:03:24 by Osei-Poku, William (NIH/NCI) [C]

Here is one from DEV. I couldn't reproduce on Prod. Even though I saw it earlier today. user account error.docx

Comment entered 2019-08-01 08:03:37 by Kline, Bob (NIH/NCI) [C]
<!-- The above is a description of an error in a Python program, formatted
     for a Web browser because the 'cgitb' module was enabled.  In case you
     are not reading this in a Web browser, here is the original traceback:Traceback (most recent call last):
  File "D:\Inetpub\wwwroot\cgi-bin\cdr\EditUser.py", line 69, in &lt;module&gt;
    error = cdr.putUser(session, usrName, user)
  File "D:\cdr\Lib\Python\cdr.py", line 361, in putUser
    Session.User(session, **user_opts).save(user.password)
  File "D:\cdr\Lib\Python\cdrapi\users.py", line 1113, in save
    self.__save(password)
  File "D:\cdr\Lib\Python\cdrapi\users.py", line 1167, in __save
    self.session.cursor.execute(sql, tuple(values))
DataError: ('22001', '[22001] [Microsoft][ODBC Driver 13 for SQL Server][SQL Server]String or binary data would be truncated. 
Comment entered 2019-08-01 08:24:01 by Kline, Bob (NIH/NCI) [C]

The comment cannot be longer than 255 characters. Unusual use of whitespace for formatting is causing the limit to be exceeded. For example:

Converted from PDQ tables. Added Summary Publishers SupplementaryInfo Maintainers and Summary Maintainers 02/17/2010

                                        Removed misc. docs 03/15/12 wo 

                                        Upated Office 9/30/13 wo

Fix by enforcing the limit in the form, before the data gets to the database.

Comment entered 2020-04-10 15:47:13 by Kline, Bob (NIH/NCI) [C]

The maxlength attribute has been applied to the comment field, along with a tooltip indicating what that maximum is (255 characters).

Comment entered 2020-04-16 11:28:15 by Osei-Poku, William (NIH/NCI) [C]

Verified on DEV. Thanks!

Comment entered 2020-06-04 13:55:57 by Osei-Poku, William (NIH/NCI) [C]

Verified on QA. Thanks!

Attachments
File Name Posted User
user account error.docx 2019-05-17 14:03:21 Osei-Poku, William (NIH/NCI) [C]

Elapsed: 0:00:00.001513