Tina Tata 4:19 PM @Daiyaan Ijaz -- I will be using cimt on sandbox for testing FIN changes I make. I am unable to even login to UIS when I point to that DB. I will be clearing all data including company and user tables. Daiyaan Ijaz 4:20 PM Hi tina 4:20 just a sec 4:22 DELETE FROM[cim - metadata - sandbox].[dbo].[project_vin_map] DELETE FROM[cim - metadata - sandbox].[dbo].[event_log] DELETE FROM[cim - metadata - sandbox].[dbo].[blocks] DELETE FROM[cim - metadata - sandbox].[dbo].[sequences] DELETE FROM[cim - metadata - sandbox].[dbo].[project] WHERE company_rid = 2 DELETE FROM[cim - metadata - sandbox].[dbo].[block_connections] DELETE FROM[cim - metadata - sandbox].[dbo].[sync_metadata] DELETE FROM[cim - metadata - sandbox].[dbo].[sync_page] DELETE FROM[cim - metadata - sandbox].[dbo].[sync_control_element] DELETE FROM[cim - metadata - sandbox].[dbo].[vin] DELETE FROM[cim - metadata - sandbox].[dbo].[configuration] DELETE FROM[cim - metadata - sandbox].[dbo].[user] DELETE FROM[cim - metadata - sandbox].[dbo].[project] DELETE FROM[cim - metadata - sandbox].[dbo].[company] DELETE FROM[cim - metadata - sandbox].[dbo].[client] 4:22 run this a couple times 4:22 like 3-4 until it says 0 to clear 4:22 due to constraints and it not being in order 4:22 may wanna change the company_rid part 4:23 change cim to cimt since theres that as well Tina Tata 4:23 PM I have the delete data in order script Daiyaan Ijaz 4:23 PM gotcha 4:23 what point in the process is it interrupted. 4:23 are we receiving anything in console 4:23 ? 4:24 or nest server Tina Tata 4:24 PM I am unable to login 4:24 2023-05-10 20:14:03.357 WARN [cim-upfitter-api,2c9d6a521b7c398d,2c9d6a521b7c398d] 19528 --- [nio-8080-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 2627, SQLState: 23000 2023-05-10 20:14:03.357 ERROR [cim-upfitter-api,2c9d6a521b7c398d,2c9d6a521b7c398d] 19528 --- [nio-8080-exec-2] o.h.engine.jdbc.spi.SqlExceptionHelper : Violation of UNIQUE KEY constraint 'UK_Company_CompanyName'. Cannot insert duplicate key in object 'dbo.company'. The duplicate key value is (Ford Test Company). 2023-05-10 20:14:03.437 ERROR [cim-upfitter-api,2c9d6a521b7c398d,2c9d6a521b7c398d] 19528 --- [nio-8080-exec-2] c.f.f.u.r.UpfitterResponseBuilder : Could not find CompanyUuid com.ford.fordprocim.upfitter.exception.DataNotFoundException: Could not find CompanyUuid at com.ford.fordprocim.upfitter.service.cim.AccountUserDetailsService.loadUser(AccountUserDetailsService.java:70) ~[main/:na] Daiyaan Ijaz 4:24 PM random but 4:24 in application-local.yml 4:24 url: https://api.stg01e.gcp.ford.com/pro/upfit/company 4:24 make sure its stg01e 4:24 not d01e Tina Tata 4:25 PM it is Daiyaan Ijaz 4:25 PM it looks like 4:25 when i see Ford Test Company 4:25 that makes me wonder 4:25 it looks like its grabbing company details 4:25 from the principle object 4:26 the hydration done when we receive the token Tina Tata 4:26 PM pbly my companyuuid is different from yours which was already added Daiyaan Ijaz 4:26 PM Ford Test Company is what returns from there Tina Tata 4:26 PM not inserting with same name is failing Daiyaan Ijaz 4:26 PM but when we HIT 4:26 the company api endpoint 4:26 you will see the company name 4:26 is not Ford Test Company 4:26 oh it is 4:26 my fault i lied 4:27 ok one second 4:30 it sounds like we have a constraint 4:30 on the name of the company 4:30 maybe the UUID is different Tina Tata 4:30 PM yes Daiyaan Ijaz 4:30 PM oh like you said 4:30 is the uuid different? 4:30 and if so i wonder why? 4:30 could be escaping case sensitivity? 4:30 because we should first be checking to see if company exists Tina Tata 4:31 PM no 4:31 when I login I am getting follwoing 4:31 companyApiUrl ---- > https://api.stg01e.gcp.ford.com/pro/upfit/company companyUuid --> 810b4f59-8564-4123-bd95-295f3dfb1318 companyName --> Ford Test Company Daiyaan Ijaz 4:32 PM in the DB Tina Tata 4:32 PM your companyuuid is different Daiyaan Ijaz 4:32 PM it should be inserted as caps 4:32 so maybe comparison is lowercase? Tina Tata 4:32 PM i dont think so 4:32 C9DEC19F-4530-41C0-A477-4524C5C10123 -- this is the company uuid that is already there (from your login) Daiyaan Ijaz 4:33 PM if thats the case 4:33 data needs to be wiped? 4:34 going from what you shared, it seems the company exists 4:34 as we saw the uuid may be different yes Tina Tata 4:34 PM can you point to cimm sandbox and see if you are able to login Daiyaan Ijaz 4:34 PM yeah\ Tina Tata 4:36 PM can you try and check Daiyaan Ijaz 4:36 PM doing it now 4:36 i made the changes Tina Tata 4:36 PM 810B4F59-8564-4123-BD95-295F3DFB1318 -- Company uuid in the cimm company table and matches mine and all users using cimm db Daiyaan Ijaz 4:36 PM logging in.. Tina Tata 4:36 PM your companyuuid pbly needs to be updated in FordPro (edited) Daiyaan Ijaz 4:37 PM companyApiUrl ---- > https://api.stg01e.gcp.ford.com/pro/upfit/company 2023-05-10 20:37:01.520 WARN [cim-upfitter-api,e691082792a21c30,e691082792a21c30] 28916 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 2627, SQLState: 23000 2023-05-10 20:37:01.520 ERROR [cim-upfitter-api,e691082792a21c30,e691082792a21c30] 28916 --- [nio-8080-exec-1] o.h.engine.jdbc.spi.SqlExceptionHelper : Violation of UNIQUE KEY constraint 'UK_Company_CompanyName'. Cannot insert duplicate key in object 'dbo.company'. The duplicate key value is (Ford Test Company). 2023-05-10 20:37:01.655 ERROR [cim-upfitter-api,e691082792a21c30,e691082792a21c30] 28916 --- [nio-8080-exec-1] c.f.f.u.r.UpfitterResponseBuilder : Could not find CompanyUuid com.ford.fordprocim.upfitter.exception.DataNotFoundException: Could not find CompanyUuid at com.ford.fordprocim.upfitter.service.cim.AccountUserDetailsService.loadUser(AccountUserDetailsService.java:70) ~[main/:na] at com.ford.fordprocim.upfitter.controller.AuthController.handleSignIn(AuthController.java:72) ~[main/:na] Tina Tata 4:37 PM Exactly Daiyaan Ijaz 4:37 PM i thought we wiped db? Tina Tata 4:37 PM if I clear and login that minute you will not be able login Daiyaan Ijaz 4:37 PM tina is the db wiped? Tina Tata 4:37 PM please check my earlier message 4:38 "your companyuuid pbly needs to be updated in FordPro " Daiyaan Ijaz 4:38 PM i read it 4:38 but is our db wiped? Tina Tata 4:38 PM no data is not wiped Daiyaan Ijaz 4:38 PM i thought u said we wiped db Tina Tata 4:38 PM so where you logged in first other users will not be able to login because of the company name constraint Daiyaan Ijaz 4:39 PM wait 4:39 tina 4:39 users wont be able to login because there is data that wouldn't exist otherwise in the database 4:39 data wipe is needed 4:39 the reason why the company uuid is different 4:40 is because instead of getting the details from the interceptor directly 4:40 we now use the company api Tina Tata 4:40 PM your companyuuid in fordpro needs to be updated when retuned Daiyaan Ijaz 4:40 PM ok i think we have a misunderstanding 4:40 so the data you see within the cimt database right now 4:41 is data from the token principle object 4:41 but the data you see us NOW coming in with 4:41 using the company api 4:41 is passing the token to ford company api 4:41 yes theres a constraint on company name 4:41 but only because the data inserted 4:41 within cimt 4:42 does not include the new company api 4:42 hence the new / different uuid (edited) 4:42 companyuuid in ford pro shouldn't be updated to match what exists inside of the database 4:42 we are abandoning the old data 4:42 if we remove the company api implementation i added 4:42 and not use company api to grab company name and company uuid 4:43 and instead directly from the principle object that is hydrated when we pass the token from nest to cloud 4:43 then we wont encounter the error you are experiencing right now 4:43 - 4:44 https://ford-eeit-cc.slack.com/archives/C054RHQ6X97/p1683750151692759 Daiyaan Ijaz DELETE FROM[cim - metadata - sandbox].[dbo].[project_vin_map] DELETE FROM[cim - metadata - sandbox].[dbo].[event_log] DELETE FROM[cim - metadata - sandbox].[dbo].[blocks] DELETE FROM[cim - metadata - sandbox].[dbo].[sequences] DELETE FROM[cim - metadata - sandbox].[dbo].[project] WHERE company_rid = 2 Show more Direct Message | May 10th, 2023 | View conversation 4:44 do this and you will find the error gone Tina Tata 4:51 PM is your latest code in dev branch ? Daiyaan Ijaz 4:51 PM yes 4:51 url: https://api.stg01e.gcp.ford.com/pro/upfit/company 4:51 thats why u see this 4:51 in application local 4:52 i added this Tina Tata 4:52 PM that is what I am using to login Daiyaan Ijaz 4:52 PM yes Tina Tata 4:52 PM companyApiUrl ---- > https://api.stg01e.gcp.ford.com/pro/upfit/company companyUuid --> 810b4f59-8564-4123-bd95-295f3dfb1318 companyName --> Ford Test Company Daiyaan Ijaz 4:52 PM can you wipe the db? Tina Tata 4:52 PM cimt db can I wipe ? Daiyaan Ijaz 4:53 PM i did it all the time when i was working on cimt 4:53 were we not allowed 4:53 oops 4:53 because only i was connected to cimt Tina Tata 4:53 PM exactly Daiyaan Ijaz 4:53 PM it was for my auth implementation 4:53 @rrouthu es 4:53 we wont be able to progrses 4:53 progress 4:53 without removing corrupted data 4:54 and since there are so many reference keys 4:54 and table associated with each other 4:54 you cant just remove the company row 4:54 you have to remove the associated data too Ramesh Routhu 4:54 PM better to delete all tables data Daiyaan Ijaz 4:54 PM yes 4:54 please Tina Tata 4:54 PM yes that is what I was going to do Daiyaan Ijaz 4:54 PM because the data is old 4:54 ok so boom boom problem solved 4:55 https://ford-eeit-cc.slack.com/archives/C054RHQ6X97/p1683750151692759 4:55 use this one even if u have a script 4:55 because its what i used for testing Tina Tata 4:55 PM but once I clear and I login we might have the same issue for you Daiyaan Ijaz 4:55 PM just execute a few times 4:55 why would the issue for me come tina 4:55 the data that exists 4:55 in the db 4:55 is wrong 4:55 we wont try to INSERT the company 4:55 the uuid will match 4:56 ok wait 4:56 lets do one step at a time 4:56 lets first wipe the db 4:56 please use my script 4:56 sorry that its not in order 4:56 and then after 4:56 lets look at our options Tina Tata 4:56 PM ok I am actually running late can we do this tomorrow Daiyaan Ijaz 4:56 PM yes of course Tina Tata 4:57 PM first thing in the morning I login at 7:30 I will wipe and test then we can test with you :+1: 1 Daiyaan Ijaz 4:57 PM okay 4:57 sounds good thank you 4:57 make sure the latest dev is 1:1 4:57 without any new changes 4:57 ok have a good evening Tina Tata 4:57 PM got it, alright thank you 4:57 you too! Ramesh Routhu 4:59 PM ok, bye Daiyaan Ijaz 5:08 PM for when you see this tomorrow: make sure to also wipe your upfitter.sqlite 5:08 thanks! Tina Tata 7:19 AM Daiyaan, that test worked. Cleared data from cimt sandbox, deleted sqllite and logged in from local dev branches, my user and company are inserted and able to login. Now you will not be able to login and will get same error I was getting yesterday. If Fordpro data is not fixed for now in cimt I can remove the constraint that Company name should be unique to move ahead. 7:19 image.png image.png 7:21 if you add these 2 lines to print on your end you will see your companyuuid is different from the rest of the team and I believe that is the issue. Tina Tata 9:14 AM image.png image.png 9:16 Hi Daiyaan above is the screenshot showing Ford Test Company in Prod (Ford Pro Company api) the Company UUID matches what was there in the company table before I cleared. Looks like you are pointing to Prod fordpro company api. Please point it to stage and retry we should be good. Daiyaan Ijaz 9:27 AM Right so I’m confused again 9:28 Can we call after standup? 9:28 Application id for stage is different Tina Tata 9:29 AM what is the confusion ? can you do ctrl+shft+f and search for prod fordpro api url Daiyaan Ijaz 9:36 AM url: https://api.stg01e.gcp.ford.com/pro/upfit/company ... Tina Tata 9:42 AM can you sysout the company name and company uuid like I suggested yesterday? Ramesh Routhu 9:47 AM @Daiyaan Ijaz let us look at it. I will call Ford Pro Karthik as needed. Daiyaan Ijaz 9:48 AM tina if my compnay uuid is different 9:49 from the rest of the team 9:49 why dont we just point to prod api 9:49 i can send prod native auth 9:49 so we pass prod token 9:49 unless you want to ask another team member to test 9:49 if my uuid is different 9:49 its different 9:50 image.png image.png 9:51 did my company id recently change? 9:51 this was never an issue? Ramesh Routhu 9:52 AM It is not changed 9:52 Let us look in local if it is pointing to Prod somewhere Daiyaan Ijaz 9:52 AM tina im being straight up im confused 9:53 i literally show its not pointing to prod 9:53 during debug yesterday i suggested to ensure stage 9:53 and to wipe data Ramesh Routhu 9:53 AM yes. let us have a call with Ford Pro Tina Tata 9:56 AM I have suggested 2 things: ctrl+shift+f ford pro prod api (may be hardcoded somewhere) sysout companyAPI url and company uuid in AccountDetailService If above are not going to help then something needs to be cleaned pbly -- try creating a new branch from dev (update fordpro company to point to stage) and try (edited) Daiyaan Ijaz 9:57 AM companyApiUrl ---- > https://api.stg01e.gcp.ford.com/pro/upfit/company 9:57 ... 9:57 ? 9:57 this is sysout Tina Tata 9:57 AM ok did you add companyuuid sysout same place ? Ramesh Routhu 10:00 AM @Daiyaan Ijaz : Check in psotman once on above API with your stage token 10:01 Not sure if the token is Prod one and FordPro has not configured correctly 10:01 Will join after scrum of scrums call Tina Tata 10:04 AM Daiyaan - I have removed the company name constraint in cimt for now temporary fix so we can continue. You should be able to login. try to look at the uuid mismatch when you get a chance Daiyaan Ijaz 10:04 AM companyApiUrl ---- > https://api.stg01e.gcp.ford.com/pro/upfit/company CompanyUUID --> 810b4f59-8564-4123-bd95-295f3dfb1318 CompanyName --> Ford Test Company 10:05 userDetail: { userId: 'd8f4eb09-eed2-455e-af75-1503c909336a', primaryCompanyInfo: { id: '810b4f59-8564-4123-bd95-295f3dfb1318', name: 'Ford Test Company' }, (edited) 10:05 tinaaaaa 10:05 this was never an issue Tina Tata 10:06 AM can you send me your application-local.yml Daiyaan Ijaz 10:06 AM sureeee 10:06 Again 10:06 tina i will say 10:06 i dont know what your issue is though 10:07 i showed you im using 10:07 stage company api 10:07 i showed you the uuid 10:07 is different from when u claimed its from prod 10:07 what on earth is the problem? Tina Tata 10:08 AM I dont know either, trying to figure out myself too. Need you assistance here. Daiyaan Ijaz 10:08 AM no i am asking u 10:08 what is the problem 10:08 is there a problem right now 10:08 if so what is the problem 10:08 identify the problem for me Tina Tata 10:09 AM ok I thought you were not able to login this morning Daiyaan Ijaz 10:09 AM i have shared yesterday 10:09 my first response from the beginning 10:09 was the solution i mentioned 10:09 which was wipe db 10:09 bc the data is not valid for our test case 10:09 since its old data 10:10 you can add the constraint back 10:10 now that data derived is accurate Tina Tata 10:12 AM ok thats good , I see you were able to login now -- Not sure what changed Daiyaan Ijaz 10:12 AM what changed is the old data is gone Tina Tata 10:13 AM ok I still dont understand how you were able to login before with old data. can you switch to cimm sandbox to make sure you are not getting the same error as yesterday ? Daiyaan Ijaz 10:14 AM i feel like i'm not being heard by you 10:14 because i keep saying, in writing, why this is the case 10:14 it makes me feel like you don't trust my information 10:15 the company api stuff changed 10:15 so the data that existed is corrupt 10:16 before it worked without the company api change 10:16 forward from now, i will defer you to look at my previous messages within this conversation since we are going in circles saying the same things 10:16 i have to work on other stuff now 10:17 if you need help i will be here Tina Tata 10:17 AM image.png image.png 10:17 this test is what caused my confusion. But if issue is resolved for both of us. I am good here Daiyaan Ijaz 10:24 AM i understand tina 10:24 i see where you're coming from 10:24 image.png image.png 10:24 if you look at the messages after, i explain a little why this is happening and how to move past it 10:25 i'm glad you figured it out, let me know if there's anything else Tina Tata 10:26 AM ok sure. Thank you. I will continue to use cimt for my testing. Ramesh Routhu 10:36 AM Thanks Tina and Daiyaan. Glad to know the issue is resolved. Daiyaan Ijaz 10:36 AM Wasn't an issue Ramesh Routhu 10:37 AM yes, data deletion worked Vivek Sarada :headphones: 10:47 AM daiyan , do we still need those 2 dbs ( cimm /cimt) ., which is the primary one. ? Daiyaan Ijaz 11:05 AM cimt for auth testing 11:05 cimm is primary for devs Vivek Sarada :headphones: 11:50 AM since auth is interate to dev code, shouldn't all be using the same db? Daiyaan Ijaz 11:50 AM auth testing new changes 11:50 like how tina is working on company changes required Vivek Sarada :headphones: 11:51 AM ok. got it ..this is peculiar case because of auth. (edited) Ramesh Routhu 11:53 AM yes 11:54 DevOps can decommission it in some time Daiyaan Ijaz 4:59 PM idk if someone refactored my code but 4:59 in company side of things within 4:59 cloud 4:59 when we insert in the database, make sure UUID is in caps 5:00 when we check to see if it exists in the database, make sure UUID is in caps 5:00 when we return the userDetails object, make sure the company UUID is in caps Ramesh Routhu 5:00 PM :+1: Daiyaan Ijaz 5:00 PM case sensitivity is going to cause issues.