Error Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

Topics: ASP.NET 2.0
May 19, 2009 at 10:24 AM
Edited May 19, 2009 at 10:40 AM

Hello,

I been trying to figure this out for days now.

Error:  Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)

I noticed that when creating new entries for Categories and Pages tables, the ID field created is really messed up with some weird characters, resulting in this error....(basicly the GUID does not get created correctly)

Searching throught the foruns i remind of someone mentioning a problem related with the slugs on pages table for MySQL based websites, but that doesnot seem the case....

I use MySQL as database.

Does anyone know what this is? and what could be causing this?

 

Jun 1, 2009 at 8:02 PM

I am having the same issue, the GUID for Categories is not correct.  When debugging, the value is correct in the parameter, however, when it lands in the database it is not correct.  I checked that the column type is VARCHAR(36) which should be correct so I wonder if this is an issue with the MySql.Net connector?  I upgraded to the newsest version (6.0.3) but I still have the issue as well.

Jun 1, 2009 at 8:39 PM

Ok, the GUID issue is a simple fix.  In DbBlogProvider.cs on in the InsertCategory method, call "ToString()" on "dpID.Value = category.Id" so it reads "dpID.Value = category.Id.ToString();"

Jun 7, 2009 at 12:51 PM

I tried your fix and it works perfectly.

Thanks a lot for sharing

Aug 5, 2009 at 10:06 AM

I am using V1.5.0.7, i am also having the same problem.

But there is no "DbBlogProvider.cs" file in the web package.

Anybody please help...

Coordinator
Aug 5, 2009 at 10:40 AM

binu_ji: DbBlogProvider.cs is in the BlogEngine Core project that gets compiled into a DLL file.  The DLL file is in your BIN directory.  The change they are talking about would require downloading the 'source' version, opening up the BlogEngine Core project in Visual Studio, making the change, and re-compiling the core.

Do you have Visual Studio to do this?

Aug 5, 2009 at 12:39 PM
Edited Aug 5, 2009 at 12:39 PM

Thanks for your quick reply.

Sorry i dont have Visual studio and i am not so good in that.

Can you please do the favour for me and mail me the dll file to my email binu_ji at yahoo dot com

Coordinator
Aug 6, 2009 at 12:32 AM

binu_ji: I emailed you a fixed copy of the DLL.

This fix that puredotnet brought up was also just applied in BE 1.5.1.15.

Coordinator
Aug 6, 2009 at 12:48 AM

And a couple more updates in BE 1.5.1.16 to cast the Category Id from a Guid to a string when a category is being Updated or Deleted (in DbBlogProvider).

Aug 6, 2009 at 3:54 AM

Thank you Ben, i got it :)

Aug 8, 2009 at 3:11 PM

Would you please send me a copy of the fixed DLL also?

Coordinator
Aug 8, 2009 at 10:46 PM

The latest build of BE, available on the Source Code tab above, includes these fixes.

If you download a build from the Source Code tab, you do have to compile the BE Core project.

It can be compiled by downloading the free Visual Web Developer Express.

Oct 12, 2009 at 5:07 PM

Hi Ben, can you send me a copy of the DLL as well please?

Oct 15, 2009 at 7:21 PM

Ben- Can you also email me a copy of the DLL?  I need to fix this issue urgently.  Would very much appreciate it.

May 4, 2010 at 8:06 PM
I'm having this same issue with 1.6.1 while trying to save new pages. I ran to source code through visual studio, but was unable to replicate the error on my local machine. Its only bugging out on my discountasp.net setup with IIS7. Anyone have any ideas?
Nov 30, 2010 at 6:53 PM
Edited Nov 30, 2010 at 7:17 PM

i have the same problem when trying to save a page on a fresh installation.

the problem is on a 2.0.0 installation as well as on 2.0.8

the strange thing is that i uploaded from my pc where i had already tested adding pages with success.

after deployng to winhost and creating a new database, i just changed my password and tried to add a page.

on the top of page i see an error message(yellow)sayng :

blogengine Could not save page: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

i checked the toppage  solution and i have id.tostring() everywhere in DBProvider.cs (post page cathegory etc)

 

does anyone have the same isuue or a good solution to try ?

 

thanx daniele

Coordinator
Nov 30, 2010 at 8:13 PM

daniele, is your database MySQL?  Does the error only occur when creating a Page?  Can you create a Post, or create a new Category?

Nov 30, 2010 at 9:04 PM
Edited Nov 30, 2010 at 9:28 PM

I'm using MSSQL database. I can create posts and categories but not pages.

I could try to re-install everything from my local machine, where everything works fine.

Nov 30, 2010 at 9:30 PM

a bit of history of my installation ..

Normally i think this would make sense so i tried:
- copy all files and folder from my machine to the hosting, including the web config (with new online connection string).
- In the meanwhile would have deleted all tables from MSSql DB and recreate them using my own script taken from local machine database.
but i am not shure i can follow the method above

Infact before this fresh install I tried doing so and found those problems : 
1- user admin could not log in (the admin user row was in the db..)
2- pages where not shown instead an error about IsDeleted column missing in the table.
this was strange for me because i had no errors in creating - running the DB script nor in FTPing the folders.

do i miss the right path for deployng be.net from a testing evironment to a live hosting ?

Coordinator
Nov 30, 2010 at 9:39 PM

danceoften getting this error because he uses different locale. Problem here is that on post save we compare localized string to check if page has parent, like this:

if (parent == string.Format("-- {0} --", Resources.labels.noParent))

Looks like web method in ajax helper does not inherit locale from the application, and it compares for example English version against Italian.

If you add this in the beginning of the Admin.AjaxHelper.SavePage(), it will set same locale for the web method and all will work fine:

System.Threading.Thread.CurrentThread.CurrentUICulture = Utils.GetDefaultCulture();

 

I'll check in fix for this issue later today.

Nov 30, 2010 at 11:07 PM
first of all, before changing the code, i set the BE language to italian and.. i can add pages!!!

rtur wrote:

danceoften getting this error because he uses different locale. Problem here is that on post save we compare localized string to check if page has parent, like this:

if (parent == string.Format("-- {0} --", Resources.labels.noParent))

could it be better to string.format with a fixed en-US format provider?

Looks like web method in ajax helper does not inherit locale from the application, and it compares for example English version against Italian.

If you add this in the beginning of the Admin.AjaxHelper.SavePage(), it will set same locale for the web method and all will work fine:

System.Threading.Thread.CurrentThread.CurrentUICulture = Utils.GetDefaultCulture();

but actually i do not understand how locale of the current thread is involved with guid generation.

I'll check in fix for this issue later today.

thanx so much for solving the issue, BE is a grat stuff, and i'm learning quickly to do what i need with BE base

 

Dec 27, 2010 at 9:43 AM

I am getting same error while creating new page in blogengine.net 2.0 Rc how can fix this error

Dec 27, 2010 at 11:06 AM

any version in december i guess. try the latest

and: did you deploy a locally configured installation(ftp from local testing) or from scratch(ftp just downloaded and created a new db) ?

Mar 2, 2011 at 8:07 PM

I am also having the same problem with GUID while creating a new category. I have the recent BlogEngine 2.0 source download where the bug has already been fixed. But still I am getting the same error.

Here is the error details :

Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).


Source Error:

Line 108:			Category cat = new Category(txtNewCategory.Text, description);
Line 109:			if (ddlNewParent.SelectedValue != "0")
Line 110:				cat.Parent = new Guid(ddlNewParent.SelectedValue);
Line 111:
Line 112:			cat.Save();

 

I am using MSSQL. Please help me on this.