error log "Error in user maintenance"

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
ksolito
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Tue Nov 25, 2008 3:16 pm

error log "Error in user maintenance"

Post by ksolito » Wed Aug 12, 2009 12:29 pm

We're getting about a dozen of these a day in the error log:

Severity: Error

Message: Error in user maintenance

Debug Data: DELETE statement conflicted with COLUMN REFERENCE constraint 'ac_Users_ac_Orders_FK1'. The conflict occurred in database 'shoote1_abc01', table 'ac_Orders', column 'UserId'. The statement has been terminated.

Anybody have any idea what the problem is and what I need to do to fix it?

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: error log "Error in user maintenance"

Post by Logan Rhodehamel » Wed Aug 12, 2009 11:03 pm

I believe this was a situation corrected for AC 7.0.2. What version is the error occuring in?
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

ksolito
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Tue Nov 25, 2008 3:16 pm

Re: error log "Error in user maintenance"

Post by ksolito » Thu Aug 13, 2009 6:43 am

v7.0.3, just upgraded from 7.0.2.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: error log "Error in user maintenance"

Post by Logan Rhodehamel » Thu Aug 13, 2009 8:15 am

Is the database SQL 2000, SQL 2005, or SQL 2008?
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

ksolito
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Tue Nov 25, 2008 3:16 pm

Re: error log "Error in user maintenance"

Post by ksolito » Thu Aug 13, 2009 11:26 am

Showing as SQL Server 8.0.2055 so SQL Server 2000.

bhill
Lieutenant Commander (LCDR)
Lieutenant Commander (LCDR)
Posts: 84
Joined: Mon Oct 31, 2005 5:06 pm
Location: Institute

Re: error log "Error in user maintenance"

Post by bhill » Mon Aug 24, 2009 11:57 am

We are getting this error as well but using VERSION: 7.0.2
SQL 2005

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: error log "Error in user maintenance"

Post by mfreeze » Tue Sep 22, 2009 9:31 am

I am also getting these messages. They seem to occur once a day. The SQL server is 2005 and AC is at 7.0.2.

I am getting the messages for both user and checkout maintenance. The full messages are:

Error in anonymous checkout maintenance The DELETE statement conflicted with the REFERENCE constraint "ac_Users_ac_Orders_FK1". The conflict occurred in database "ac7_diabetesandmore", table "diabetes.ac_Orders", column 'UserId'. The statement has been terminated.

Error in user maintenance The DELETE statement conflicted with the REFERENCE constraint "ac_Users_ac_Orders_FK1". The conflict occurred in database "ac7_diabetesandmore", table "diabetes.ac_Orders", column 'UserId'. The statement has been terminated.

Has there been any resolution or explanation for these messages?

Could these errors have anything to do with an inordinate number of abandoned baskets that we have seen since the upgrade to 7.0.2?

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: error log "Error in user maintenance"

Post by Logan Rhodehamel » Tue Sep 22, 2009 5:56 pm

mfreeze wrote:Has there been any resolution or explanation for these messages?

Could these errors have anything to do with an inordinate number of abandoned baskets that we have seen since the upgrade to 7.0.2?
Your messages seem to be different. Were there any problems on database upgrade? Back up your database, then try this script:

Code: Select all

IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME = 'ac_Orders'
AND CONSTRAINT_NAME = 'ac_Users_ac_Orders_FK1')
BEGIN
	ALTER TABLE ac_Orders
	DROP CONSTRAINT ac_Users_ac_Orders_FK1
END
GO


ALTER TABLE ac_Orders ADD CONSTRAINT
	ac_Users_ac_Orders_FK1 FOREIGN KEY
	(
	UserId
	) REFERENCES ac_Users
	(
	UserId
	) ON UPDATE  NO ACTION 
	 ON DELETE  SET NULL 
GO
We had to allow the ac_Orders.UserId field to accept nulls so that a user could be removed without losing associated order history. In your database, the constraint prevents a user with orders from being deleted. This is especially problematic for "anonymous" users who have a dummy account created during the order process. Maintenance is supposed to remove these accounts as they contain no useful (in the long term) information.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: error log "Error in user maintenance"

Post by mfreeze » Tue Sep 22, 2009 7:51 pm

I received some errors when trying to run the script. I changed ac_orders to xxxxx.ac_orders where xxxxx = the table owner name and got rid of the first set. Then I got:

Msg 2714, Level 16, State 4, Line 3
There is already an object named 'ac_Users_ac_Orders_FK1' in the database.
Msg 1750, Level 16, State 0, Line 3
Could not create constraint. See previous errors.
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

User avatar
mfreeze
Commodore (COMO)
Commodore (COMO)
Posts: 421
Joined: Mon Jan 24, 2005 2:07 pm
Location: Washington, NJ
Contact:

Re: error log "Error in user maintenance"

Post by mfreeze » Tue Sep 22, 2009 8:32 pm

BTW. I just upgraded to 7.03. Does the script still need to be run? Should I wait to see if the errors appear again?

I got no errors with the DB upgrade to 7.02 or 7.03.

Also, could these errors explain a HUGE increase in abandoned baskets after the 7.02 upgrade? We went from 2-4 per day before the upgrade to 20-30 after. Most of these abandoned baskets are anonymous users.
Mary E Freeze

Freeze Frame Graphics
Web Hosting and Design, ASP and CFMX Development

http://www.ffgraphics.com

ksolito
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Tue Nov 25, 2008 3:16 pm

Re: error log "Error in user maintenance"

Post by ksolito » Thu Oct 08, 2009 6:52 am

Logan,

I ran your script from two posts above (Tue Sep 22, 2009 5:56 pm) and got the following error:
Msg 156, Level 15, State 1, Line 11
Incorrect syntax near the keyword 'SET'.
System is:
PLATFORM: ASP.NET
VERSION: 7.0.3
BUILD: 12458
MSSQL v2000
AC SCHEMA v2000

This problem has been remained unresolved for a long time and we continue to get anywhere from 6 to a dozen or more of these errors daily. I am open to any suggestions on how to resolve it.

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: error log "Error in user maintenance"

Post by Logan Rhodehamel » Thu Oct 08, 2009 9:34 am

ksolito wrote:Logan,

I ran your script from two posts above (Tue Sep 22, 2009 5:56 pm) and got the following error:
My script above was specific to SQL 2005. I can help you get your database back to good in the following steps, specific to SQL 2000 servers.

1. Backup your database
2. Remove existing constraint
3. Add the correct constraint
4. Drop existing trigger for user deletes
5. Add correct trigger for user deletes

Step 1: Back up your database. If you do not, and something is wrong with this script, you won't be able to recover. So just make a backup and be safe. If something goes wrong you can restore and report back.

For the remainder of the steps, run this script through query analyzer:

Code: Select all

/* STEP 2: Remove existing constraint */
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLE_CONSTRAINTS WHERE TABLE_NAME = 'ac_Orders'
AND CONSTRAINT_NAME = 'ac_Users_ac_Orders_FK1')
BEGIN
   ALTER TABLE ac_Orders
   DROP CONSTRAINT ac_Users_ac_Orders_FK1
END
GO

/* STEP 3: Add the correct constraint */
alter table "ac_Orders"
with nocheck
add constraint "ac_Users_ac_Orders_FK1" foreign key ("UserId")
references "ac_Users" ("UserId") on update no action  
go

/* STEP 4. Drop existing trigger for user deletes */
IF EXISTS (SELECT name FROM sysobjects WHERE name = 'ac_Usersdelete' AND type = 'TR')
    DROP TRIGGER ac_Usersdelete
GO

/* STEP 5. 5. Add correct trigger for user deletes */
Create trigger "ac_Usersdelete" on "ac_Users" 
for delete 
as
BEGIN
  declare
	@errorNumber int,
	@errorMsg varchar(255)

  /* Clause for ON DELETE to referenced table SET NULL */
  update "ac_AuditEvents"
  set "ac_AuditEvents"."UserId" = NULL
  from deleted,"ac_AuditEvents"
  where "ac_AuditEvents"."UserId" = deleted."UserId"

  /* Clause for ON DELETE to referenced table SET NULL */
  update "ac_OrderNotes"
  set "ac_OrderNotes"."UserId" = NULL
  from deleted,"ac_OrderNotes"
  where "ac_OrderNotes"."UserId" = deleted."UserId"

  /* Clause for ON DELETE to referenced table SET NULL */
  update "ac_Orders"
  set "ac_Orders"."UserId" = NULL
  from deleted,"ac_Orders"
  where "ac_Orders"."UserId" = deleted."UserId"

  return
  errorHandler:
    raiserror @errorNumber @errorMsg
  rollback transaction
END
go
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

sfeher
Captain (CAPT)
Captain (CAPT)
Posts: 220
Joined: Fri Jun 04, 2004 1:58 pm
Location: Steubenville, Ohio

Re: error log "Error in user maintenance"

Post by sfeher » Tue Nov 03, 2009 7:06 am

Logan --
Getting this same error on SQL 2008. My specs:

PLATFORM: ASP.NET
VERSION: 7.0.3
BUILD: 12458
MSSQL v2008
AC SCHEMA v2000

User avatar
Logan Rhodehamel
Developer
Developer
Posts: 4116
Joined: Wed Dec 10, 2003 5:26 pm

Re: error log "Error in user maintenance"

Post by Logan Rhodehamel » Tue Nov 03, 2009 9:42 am

sfeher wrote:PLATFORM: ASP.NET
VERSION: 7.0.3
BUILD: 12458
MSSQL v2008
AC SCHEMA v2000
I should have qualified this better. I believe you will need to follow the instructions for the SQL 2000 from the comment immediately prior to yours. Please back up your database first.

Your AC schema is still using the 2000 model, even though you have the newer database. I am pretty certain we published a schema upgrade script with 7.0.3 if you are interested in upgrading that.
Cheers,
Logan
Image.com

If I do not respond to an unsolicited private message, it's not because I'm ignoring you. It's because the answer to your question is valuable to others. Try the new topic button.

User avatar
Kalamazoo
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Wed Apr 01, 2009 6:10 pm

Re: error log "Error in user maintenance"

Post by Kalamazoo » Mon Jul 26, 2010 7:42 pm

I have a client with AC 7.03 SP1 and we just ran the above 5 step script with no known errors on SQL 2008. I will post back if this has worked.

Thank you.

Phil Chrisman

User avatar
Kalamazoo
Lieutenant, Jr. Grade (LT JG)
Lieutenant, Jr. Grade (LT JG)
Posts: 42
Joined: Wed Apr 01, 2009 6:10 pm

Re: error log "Error in user maintenance"

Post by Kalamazoo » Mon Aug 02, 2010 3:36 pm

Just to keep you updated. This ran in SQL 2008 no problem. I have one errant record now that gives off one entry in the error log each day so hopefully I can go in and just "root-it-out" of the database.

But all in all, I am very pleased with how well this ran in SQL 2008 and IIS7.

All the best,

Phil Chrisman

dnoell
Ensign (ENS)
Ensign (ENS)
Posts: 19
Joined: Mon Jul 07, 2008 9:36 am

Re: error log "Error in user maintenance"

Post by dnoell » Tue Aug 03, 2010 8:12 am

I am receiving the error "Error in user maintenance" as reported by everyone else but I have the following in Debug Data message:
"Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding." I am also receiving the following error messages with the debug data above:

1. Error in anonymous checkout maintenance
2. Error in payment account data maintenance
3. Error in anonymous checkout maintenance

I am running an earlier version of AbleCommerce that has been **very stable** for two years. Why would these errors appear now? The error has been appearing regularly for the past week. Any help would be appreciated.

My version of AbleCommerce is as follows:
PLATFORM: ASP.NET
VERSION: 7.0.0
BUILD: 11659

Thanks for any help understaning this issue,

David Noell

sfeher
Captain (CAPT)
Captain (CAPT)
Posts: 220
Joined: Fri Jun 04, 2004 1:58 pm
Location: Steubenville, Ohio

Re: error log "Error in user maintenance"

Post by sfeher » Thu Jan 20, 2011 7:23 am

Logan_AbleCommerce wrote:
sfeher wrote:PLATFORM: ASP.NET
VERSION: 7.0.3
BUILD: 12458
MSSQL v2008
AC SCHEMA v2000
I should have qualified this better. I believe you will need to follow the instructions for the SQL 2000 from the comment immediately prior to yours. Please back up your database first.

Your AC schema is still using the 2000 model, even though you have the newer database. I am pretty certain we published a schema upgrade script with 7.0.3 if you are interested in upgrading that.
Logan --
Coming back to this issue (after quite some time)..... still seeing a large number of abandoned carts from anonymous users. You mentioned an schema upgrade script for 7.0.3. --- can I give that a shot?

meer2005
Captain (CAPT)
Captain (CAPT)
Posts: 245
Joined: Wed Feb 09, 2005 2:00 pm

Re: error log "Error in user maintenance"

Post by meer2005 » Wed Jan 22, 2014 10:23 am

Ran the schema update that was part of the 7.0.3 bundle and it said it was successful, but the admin still says AC SCHEMA v2000?? Any ideas?

Post Reply