02-02-2021 02:17 AM - edited 02-03-2021 12:45 AM
Welcome to Episode 2: Validation strikes back : )
Hi there, I've just found another problem related to calendar management via API (see here episode 1). I was creating shifts for a FLEXIBLEHOURS calendar (with id=1) exploiting API (HTTP/PUT), when suddenly all got stuck.
Symptoms:
admin:run uccx sql db_cra select * from dayshiftmap WHERE recordid = 796 Internal CLI Error: java.sql.SQLException: Encoding or code set not supported.
My explanation:
It looks like I entered a shift name that for some reasons (e.g., encoding, illegal chars, etc...) broke all the queries related with it (i.e., the calendar list, the calendar such a shift belongs to). Again, the problem here is that the CCX is supposed to perform a data validation before writing to the DBMS (the default Informix, in my case). But it didn't happen, breaking the most of the calendar management.
Quick fix:
If you are experiencing this problem (I hope not!), you can try to fix the broken record up. For example, you can write an update query (stick with this thread for updates about it)
Long Term Fix (hopefully by Cisco!):
Cisco CCX, please, do not allow the write of nasty data, if you really don't like it! Not only from Web interface, but also from API calls (see here episode 1 for similar stuff).
Solved! Go to Solution.
02-03-2021 10:25 AM
Hi,
I reached out to the CCX team about your issue and stated that they do indeed do data validation, but it seems like the specific sequence of characters that you used must have been missed. I will open a defect for it. They recommended that you open a TAC case to fix the broken record on your system. If the TAC engineer gives you any pushback, please have them contact me (Denise Kwan).
Thanx,
Denise
02-03-2021 02:14 PM
Hi,
Just FYI, I opened CSCvx24333 for the team to improve the server-side data validation. Since I just opened the bug, it will not be visible to the public yet and it will take some time to go through the process and system.
Thanx,
Denise
02-02-2021 02:43 AM
UPDATE: It seems like the quick fix isn't feasible. Not via the CLI, at least. Cisco DOC says:
run uccx sql database_name sql_query
Executes an SQL "select" statement from the CLI. Read-only operations are permitted. Insert, Update, Delete and any DML statements are disallowed.
I look forward to receiving some hints!
02-02-2021 06:20 AM
Any chance you've opened a TAC case on this, including your first episode? It really does seem that server side validation is not happening or broken.
david
02-03-2021 12:05 AM
I haven't yet opened a TAC about that so far but I'll do it as soon as possibile. This is definitely the way to request a permanent patch and avoid similar problems in the future.
In the meanwhile, I need to fix my specific problem (i.e., the nasty db entry). Theoretically speaking, I just need a way to run an update query against db_cra.dayshiftmap. Any idea about how to do that? Reinstalling the CCX from scratch is not an option.
02-03-2021 10:25 AM
Hi,
I reached out to the CCX team about your issue and stated that they do indeed do data validation, but it seems like the specific sequence of characters that you used must have been missed. I will open a defect for it. They recommended that you open a TAC case to fix the broken record on your system. If the TAC engineer gives you any pushback, please have them contact me (Denise Kwan).
Thanx,
Denise
02-03-2021 02:14 PM
Hi,
Just FYI, I opened CSCvx24333 for the team to improve the server-side data validation. Since I just opened the bug, it will not be visible to the public yet and it will take some time to go through the process and system.
Thanx,
Denise
02-04-2021 01:25 AM
Hi Denise,
thank you again for your kind help. Regarding the server-side validation of calendar data, please, have also a look at Episode 1 here tl;dr: Fixedhours calendar can be created with non-fixed hours, and more... The point here is that server-side validation follows different rules respect to the Web interface. Maybe some pieces of data validation are client-side only.
Cheers!
- A.
03-02-2021 10:28 AM
Hi @floatingpurr,
The CCX team is currently working on fixing the bug. In your post, you stated:
It looks like I entered a shift name that for some reasons (e.g., encoding, illegal chars, etc...) broke all the queries related with it (i.e., the calendar list, the calendar such a shift belongs to). Again, the problem here is that the CCX is supposed to perform a data validation before writing to the DBMS (the default Informix, in my case). But it didn't happen, breaking the most of the calendar management.
They were not able to reproduce this issue, so would you be able to share the shift name that you used to cause this issue? They have already worked on adding validation so that fixed calendars cannot accept non fixed hours.
Thanx,
Denise
03-03-2021 05:05 AM
Hi @dekwan,
I'm glad to hear that the CCX Team is on it.
Regarding your question, I do not remember the exact string that broke the CCX db (via API). However, this is what we found out in the db w/ the TAC Engineer upon examining the table dayshiftmap as root:
This means that probably the string was "Turno lungo del mercoled?". Maybe the problem was the question mark (just guessing).
Let me know if you need more context.
Bye!
- A.
03-03-2021 10:01 AM
Hi,
Thank you. I will pass this information on to them.
Thanx,
Denise
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide