Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Anders Ingemarsson 2 posts 22 karma points
    Mar 12, 2014 @ 00:45
    Anders Ingemarsson
    0

    Saving in Backoffice fails

    I cant save anything in backoffice. I´m a new to Umbraco, so this might just be some stupid thing I´ve done.

    Here is what I´ve done so far.

    I started a new empty MVC project in Visual Studio (2012) and used NuGet to install Umbraco7. I used Txt Starter kit, and a local SQLEXPRESS database. I ran the project from within Visual Studio and that worked fine. So I started to tweek the CSS a bit, changed the starter kit pictures for my own pics and then finally I uploaded the web site to my hosting provider(the files and the database) . Had some trouble here, but then i used SSH (putty) to connect to my hosting provider and then exporting my local database from MS SQL Server Management Studio.

    This worked and everything seamed to be fine, But then when I try to change something from Backoffice, it fails.

    I get error messages like this one:

    Server error: Contact administrator, see log for full details.

    Cannot insert the value NULL into column 'id', table '119446-yaf.dbo.cmsContentVersion'; column does not allow nulls. INSERT fails. The statement has been terminated.

    and also this:

    Server error: Contact administrator, see log for full details.

    [A]System.Net.Http.Headers.ContentDispositionHeaderValue cannot be cast to [B]System.Net.Http.Headers.ContentDispositionHeaderValue. Type A originates from 'System.Net.Http, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\6d855b1a\f4fb7ee3\assembly\dl3\9a6b99c7\7e83dad3_f330cf01\System.Net.Http.dll'. Type B originates from 'System.Net.Http, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' in the context 'Default' at location 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Net.Http\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Net.Http.dll'.

    When I look in the Umbraco database I´ve got id´s that have negative values...

    I can also see that I set the Target framework of my Visual Studio project to NET 4, as I was not sure if my web hosting would support NET 4.5 (now I know that they do).

    Maybe I´ve done some really idiotic things, but is there a way to fix this?

  • Sebastiaan Janssen 5045 posts 15476 karma points MVP admin hq
    Mar 12, 2014 @ 08:04
    Sebastiaan Janssen
    0

    Try to add this to you web.config in the runtime/assemblyBinding section:

      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="4.0.0.0" />
      </dependentAssembly>
    
  • Anders Ingemarsson 2 posts 22 karma points
    Mar 12, 2014 @ 22:22
    Anders Ingemarsson
    0

    Thanks for your answer Sebastiaan, but I still have the same problem. When I try to save something from the backend, then I get error message: (for instance changing some text on my Home - page)


    Server error: Contact administrator, see log for full details. Cannot insert the value NULL into column 'id', table '119446-yaf.dbo.cmsContentVersion'; column does not allow nulls. INSERT fails. The statement has been terminated.


    When I got to the Media Types-section and try to change the Icon I get the YSOD and the stack trace:


    [SqlException (0x80131904): Cannot insert the value NULL into column 'id', table '119446-yaf.dbo.umbracoLog'; column does not allow nulls. INSERT fails. The statement has been terminated.] System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase) +412 System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData) +10972548 System.Action`1.EndInvoke(IAsyncResult result) +0 umbraco.controls.ContentTypeControlNew.EndAsyncSaveOperation(IAsyncResult ar) +341 System.Web.UI.


    However, if I go to the Users section and change something for my administrator login, then this succeeds and I can see it in umbracoUser-table (and if i logout and back in again). But if I try to create a new user then when I click Create, it silently closes like if i would have clicked cancel (no error message and still only one user in the umbracoUser table).

    I´m also trying to find some info on the database but I´m getting server errors when searching here on our.umbraco.org. Is there some other place to find info about the database schema?

  • ian 35 posts 135 karma points
    Feb 03, 2015 @ 10:01
    ian
    0

    Hi,

    I am getting exactly the same CANNOT insert value NULL error after importing the database throught SQL studio into my hosted database. My site works fine it's just when I attempt to update something in the backoffice. Did you find a solution? I'm thinking it's something to to with Primary key not set on import/ auto increment? possible across all tables not just this?

    Hope you can help

     

    Ian

  • AJS 31 posts 212 karma points
    Dec 22, 2015 @ 23:40
    AJS
    0

    Hi Ian,

    Did you ever figure this out? I'm having the same issue after transferring my site from my local machine to the hosting provider.

    Thanks,

    Amanda

  • Nitin Anand 46 posts 178 karma points
    Mar 14, 2017 @ 09:47
    Nitin Anand
    0

    Exactly same error in my project. All works well in localDB SQL but once i use online Database this error doesnt allow me to change/Edit content. Any solutions yet? thanks in advance

  • Bobi 346 posts 950 karma points
    Apr 06, 2017 @ 20:43
    Bobi
    0

    Did anyone figure this out? If so, what did you do?

  • Nitin Anand 46 posts 178 karma points
    Apr 07, 2017 @ 08:35
    Nitin Anand
    0

    hi Bobi

    this worked in my case:

    I was trying by to import data from the localDB (the fine working database) to the db on server and when i start application by connecting to this new db on server, i was getting error.

    I found that the error was in the method/way of transferring data from localDB to online/server db.

    the method to copy/transfer data which helped with giving a stable db is like this:

    1. Convert the local database to .sdf Compact edition using SQL compact Toolbox.

    2. Once you have .SDF file copy the script and use this script to create new database.

    starting app connecting this db worked for me n im not having these errors anymore.

  • Kishor 1 post 71 karma points
    Jul 30, 2017 @ 01:18
    Kishor
    0

    The problem is at database column constraint. When umbraco creates database the Id is set to primary auto-increment, but I found that after copying database to hosting server, it is neither primary nor auto-incremented. I think its all about how we copy database. As Nitin Mentioned, it's better to run script and create database manually.

    This is my hosting database

    enter image description here

    And this is my local

    enter image description here

  • Hong 66 posts 228 karma points
    May 09, 2018 @ 17:00
    Hong
    0

    I had the same problem earlier today after using SSMS to export an Umbraco database from a SQL server to A2hosting's SQL server. Here is what I did to solve the problem:

    In SSMS Right-click the Umbraco database > Task > Backup... > OK

    On A2Hostiing's Plesk control panel:

    Databases > Import Dump > Choose File > Select the backup file.

Please Sign in or register to post replies

Write your reply to:

Draft