Friday, December 24, 2010

Android 2.2 update breaks 3G on O2

So my HTC Magic got the Froyo update last week. The problem was that it broke "the internet".

I thought it was due to the fact that my phone was an Australian Vodaphone branded HTC Magic and the update was through a UK network intended for UK/European versions of the phone. I was going to get a new phone anyway (The Nexus S) so I didn't mind, and put it aside for a later date.

Well it turns out that the mobile internet was also broken on the Nexus S (see my previous blog). In any case, once I fixed the configuration issue on the Nexus, I tried the settings on the HTC and it worked! So here are the settings I used:

APN: payandgo.co.uk
username: payandgo
password: password
MCC: 234
MNC: 10
APN type: internet

Leave everything else blank! Even the proxy!

Hopefully this works for you.

Mobile internet on Nexus S with O2 is broken

I bought the new (Samsung) Google Nexus S this week. I have to say that it is amazing! It is faster and more responsive than anything I have tried. The only problem I had was that the mobile internet was not working with the retrieved settings.

After googling the hell out of this, checking the manual settings on the O2 website, and even calling tech support, I finally figured out that the settings on the website AND the ones tech support told me were wrong.

Without any further adue, I give to you...

APN: payandgo.co.uk
username: payandgo
password: password
MCC: 234
MNC: 10
APN type: internet

If you're having this issue, hopefully these settings will do the trick.

Thursday, December 16, 2010

Cannot delete document type - Umbraco

This has been my week of Umbraco database corruption hell!

Today I wanted to delete a document type that just didn't want to budge. There was nothing in the log table, so I opened up firebug and saw this little error:


{"Message":"Umbraco Exception (DataLayer): SQL helper exception in ExecuteNonQuery","StackTrace":" at umbraco.DataLayer.SqlHelper`1.ExecuteNonQuery(String commandText, IParameter[] parameters)\r\n at umbraco.cms.businesslogic.ContentType.Tab.Delete()\r\n at umbraco.cms.businesslogic.ContentType.delete()\r\n at umbraco.cms.businesslogic.web.DocumentType.delete()\r\n at umbraco.nodetypeTasks.Delete()\r\n at umbraco.presentation.create.dialogHandler_temp.Delete(String NodeType, Int32 NodeId, String Text)\r\n at umbraco.presentation.webservices.legacyAjaxCalls.Delete(String nodeId, String alias, String nodeType)","ExceptionType":"umbraco.DataLayer.SqlHelperException"}


I started to delete the properties and tabs manually. Umbraco crashed when trying to delete a tab. It was another foreign key issue.

So again, the solution was to change a delete rule (see my last 2 posts). This time it was cmsPropertyType_cmsTab. I changed it to cascade.

Now I was able to delete the tab as normal.

After that tab was deleted, I was able to delete the document type.

I win again!


Wednesday, December 15, 2010

The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPreviewXml_cmsContentVersion". - Swap Master Doc Type Error in Umbraco

Today is my day of Umbraco database hell!

I tried to swap a master doc type. I clicked ok, confirm, yes, ok etc and then nothing!

I looked into the error logs and came cross this:


At /umbraco/theoutfield/doctypeextensions/dialogs/SwapMasterDocType.aspx?id=1071&rndo=27.8 (Referred by: http://localhost/umbraco/theoutfield/doctypeextensions/dialogs/SwapMasterDocType.aspx?id=1071&rndo=27.8): System.Data.SqlClient.SqlException: The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPreviewXml_cmsContentVersion". The conflict occurred in database "LOTUS_DEV", table "dbo.cmsPreviewXml", column 'versionId'. The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPreviewXml_cmsContentVersion". The conflict occurred in database "LOTUS_DEV", table "dbo.cmsPreviewXml", column 'versionId'. The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPreviewXml_cmsContentVersion". The conflict occurred in database "LOTUS_DEV", table "dbo.cmsPreviewXml", column 'versionId'. The statement has been terminated. The statement has been terminated. The statement has been terminated. at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) at System.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean async) at System.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(DbAsyncResult result, String methodName, Boolean sendToPipe) at System.Data.SqlClient.SqlCommand.ExecuteNonQuery() at TheOutfield.UmbExt.DocTypeExtensions.Dialogs.SwapMasterDocType.DoSwitch() at TheOutfield.UmbExt.DocTypeExtensions.Dialogs.SwapMasterDocType.btnConfirm_Click(Object sender, EventArgs e) at System.Web.UI.WebControls.Button.OnClick(EventArgs e) at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)



The solution is identical to my previous post...

Open up SQL Management Studio.
Change delete rule for the relationship between cmsPreviewXml and cmsContentVersionto "cascade".


Now you can swap those master doc types!



The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType" - Umbraco

The DELETE statement conflicted with the REFERENCE constraint "FK_cmsPropertyData_cmsPropertyType".



This was incredibly painful!

It occurs when you try to delete a property form a document type.

Here is a quick fix that does not involve manually deleting things....


Open up SQL Management Studio.
Change delete rule for the relationship between cmsPropertyType and cmsPropertyData to "cascade".

DONE!


Friday, December 10, 2010

Reseeding Umbraco

Back when I was working at The Farm we needed to do some sweeping changes to an existing Umbraco site.

To make sure the new content you upload does not conflict with additions the client makes during the development time, you must do the following... Take a back up of the live db for development, then reseed the tables of your new development db to a number much much higher. This allows you to synch up the database changes when it comes to deploy time. We reseeded the primary keys of some key tables to 500,000. (see http://www.farmcode.org/post/2009/09/09/How-to-sync-data-across-multiple-Umbraco-environments.aspx).

The issue we had though was that the time between reseeding and deployment turned out to be 3 months and the reseeding was no longer high enough. We learned this the hard way.

Today I'm about to begin the whole process on another existing Umbraco site, so I decided to check the current seeds.

Here is the script I used:

SELECT IDENT_SEED(TABLE_NAME) AS Seed,
IDENT_INCR(TABLE_NAME) AS Increment,
IDENT_CURRENT(TABLE_NAME) AS Current_Identity,
TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE OBJECTPROPERTY(OBJECT_ID(TABLE_NAME), 'TableHasIdentity') = 1
AND TABLE_TYPE = 'BASE TABLE'


It turns out that in just over 2 months, the cmsPropertyData and umbracoLog tables had current seeds of 306208 and 145973 (respectfully).

Final deliverables for this site are not until March 2011. So it seems that a reseed of even 1,000,000 might not be enough.

So I've decided to reseed to 10,000,000

Here is all I needed to run:
DBCC CHECKIDENT (cmsContent, reseed, 10000000)
DBCC CHECKIDENT (cmsContentVersion, reseed, 10000000)
DBCC CHECKIDENT (cmsPropertyData, reseed, 10000000)
DBCC CHECKIDENT (umbracoNode, reseed, 10000000)
DBCC CHECKIDENT (umbracoLog, reseed, 10000000)