Removing Item Types

If you are having a problem using Dragnet, post a message here.

Moderator: SourceGear

Locked
jgriffin

Removing Item Types

Post by jgriffin » Tue Mar 08, 2005 3:41 pm

Item types that were assigned to items were deleted. Once they were deleted, the items could no longer be viewed or retrieved. The item types were re-added to the database using INSERT statements. The items can now be retrieved and viewed, however a server 500 error displays when you attempt to modify the item. How can we resolve this issue?

Also, the application should not allow the deletion of item types that are currently used.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Tue Mar 08, 2005 4:01 pm

Yes, any attempt of deletion of an item type should be disallowed. I'll log a bug against that.

The 500 error could be related to something else done to the database. How did you update the database for the items with the deleted item type? Due to some triggers, simply changing the itemtypeid column will not work.
Jeff Clausius
SourceGear

jgriffin

Removing Item Types

Post by jgriffin » Wed Mar 09, 2005 2:13 pm

Once we added the item types back, we were going through the application to update the items with the correct item type. To add the itemtypes back, we simply ran an INSERT statement through Query Analyzer.

Any suggestions on how to fix the items that are producing the Server 500 errors when we attempt to edit them?

Thanks,
Julie

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Mar 09, 2005 2:38 pm

Can you run the following query against the Dragnet database?

Code: Select all

select i.itemid from sgdragnet.dbo.items i where not exists (SELECT it.itemtypeid FROM sgdragnet.dbo.itemtypes it where it.itemtypeid = i.itemtypeid)
What are the results for this query?
Jeff Clausius
SourceGear

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Wed Mar 09, 2005 3:00 pm

If the query above returns 0 rows, can you examine the Dragnet Server's log file? By default this is stored in %windir%\temp\sgdragnet? Does anything look suspicious there?

Also, does the Windows Event Viewer have any information related to an error?
Jeff Clausius
SourceGear

jgriffin

Removing Item Types

Post by jgriffin » Thu Mar 10, 2005 8:30 am

I ran the query and it returned 0 results.

The dragnet logs showed a "parameter incorrect" error for the Server 500.

To make sure that this error was generated when attempting to access an item, I went into the dragnet app to retrieve one of the items. I was successfully able to retrieve it. I then opened all of the items with the deleted (and re-added) item type. I was successfully able to open all of the items. Could there be a process/trigger/etc. that runs that would have fixed this problem?

Anyway, it works now.

Thanks for all of your help!!!!

jgriffin

Removing Item Types

Post by jgriffin » Thu Mar 10, 2005 8:37 am

I jumped the gun...I went in to modify the items (to change the item type). When I click the "Modify" button, I get the following error:

Error 500: The Server is unable to process your request, click the login button to go back to the login page.

The event log shows the following:
Server error 500 Specified argument was out of the range of valid values. Parameter name: value

There is nothing in the Event Viewer.

I need to be able to modify these items. Any ideas?

Thanks, in advance, for your help.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Mar 10, 2005 8:43 am

The item types... Is there a reason you did not add them through the Database section of the application? It could be something related to the table columns - using the Web Front end makes sure everything is configured correctly.

In any case, what does the following query return:

SELECT label, itemtypeid, status FROM sgdragnet.dbo.itemtypes WHERE itemtypeid > 5
Jeff Clausius
SourceGear

jgriffin

Removing Item Types

Post by jgriffin » Thu Mar 10, 2005 9:01 am

We did not use the Web Front End because the itemtype id column is an IDENTITY column and we needed the ID to be the same as the id of the item type that had been deleted.

The query returns the following:

label itemtypeid status
Change Request 101 2
Enhancement 102 2

itemtypeid 101 is the one that we deleted and re-added. I would like to modify anything with the 101 itemtypeid to 102, so that we can delete 101.

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Mar 10, 2005 9:25 am

That looks OK.

One last thing to check, I need you to restart the Dragnet service ( iisreset.exe usually does the trick ), and re-try the modification.

One other thing the Dragnet service does is cache certain items for performance reasons. Resetting IIS and checking again will show if bypassing the server invalidated its cache.
Jeff Clausius
SourceGear

jgriffin

Removing Item Types

Post by jgriffin » Thu Mar 10, 2005 9:46 am

That did it!!!!

Thanks!!!

jclausius
Posts: 3706
Joined: Tue Dec 16, 2003 1:17 pm
Location: SourceGear
Contact:

Post by jclausius » Thu Mar 10, 2005 9:55 am

Glad to hear.

Just a general word of caution. There are transactions, triggers, and caching strategies in use in Dragnet that I would never recommend directly modifying the database. If possible always try to go through the Dragnet interface itself.

However, if there are special circumstances which requires this interaction, as seen in this thread, contact us through this forum or support@sourcegear.com, and we can help guide you through those changes.
Jeff Clausius
SourceGear

Locked