Copied to clipboard

Flag this post as spam?

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


  • Andreas Pfanner 196 posts 314 karma points
    Nov 20, 2011 @ 15:20
    Andreas Pfanner
    0

    Upload error #2038 - Object reference not set (GetByDataTypeId)

    Hi,

    Multi File Upload doesn't work any more on my Umbraco installation. I don't know exactly when it stopped working, maybe after upgrade to 4.7.1 or so..

    When I try to upload images I get the error:

    There has been an I/O Error: Error #2038
    There has been an HTTP Error: status code 500

     

    On event log, I see the following: 

     Exception type: ApplicationException 

        Exception message: System.NullReferenceException: Object reference not set to an instance of an object.

       at umbraco.cms.businesslogic.datatype.DataTypeDefinition.GetByDataTypeId(Guid DataTypeId)

       at noerd.Umb.DataTypes.multipleFileUpload.DefaultImageMediaFactory.GenerateAdditionalThumbnails(Image image, Int32 fileWidth, Int32 fileHeight, String destFilePath)

       at noerd.Umb.DataTypes.multipleFileUpload.DefaultImageMediaFactory.CreateMedia(IconI parent, HttpPostedFile uploadFile)

       at noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUpload.HandleUpload(HttpContext context, Int32 nodeId)

       at noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUploadHandler.ProcessRequest(HttpContext context)

       at noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUpload.Log(LogTypes logType, Int32 nodeId, String message)

       at noerd.Umb.DataTypes.multipleFileUpload.MultipleFileUploadHandler.ProcessRequest(HttpContext context)

       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()

       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

    What's the matter here??
    Best Regards
    Andreas

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Nov 20, 2011 @ 16:14
    Jan Skovgaard
    0

    Hi Andreas

    If I remember correctly I have seen other posts about this issue and the I/O error might have something to do with session cookies being disabled perhaps? On of the other posts referenced this site about it: http://forums.asp.net/p/1182840/2024599.aspx#2024599.

    So have you tried uploading from different browsers to see if it happens in the other browsers as well. And what about the size of the file you're trying to upload? Does it exceed the limit specified in the web.config? (<httpRuntime maxRequestLength="..." />).

    /Jan

  • Andreas Pfanner 196 posts 314 karma points
    Nov 20, 2011 @ 17:39
    Andreas Pfanner
    0

    Hi Jan,

    thanks for your reply, its not a file size issue, and also no browser issue. Doesn't work in IE, Firefox, Chrome.

     

    Best Regards

    Andreas

  • Andreas Pfanner 196 posts 314 karma points
    Nov 24, 2011 @ 10:14
    Andreas Pfanner
    2

    Hi,

    many hours later, I could solve the problem. It was caused by the following method in Umbraco core (umbraco.cms.businesslogic.datatype.DataTypeDefinition):

    public static DataTypeDefinition GetByDataTypeId(Guid DataTypeId)
            {
                int dfId = 0;
                foreach (DataTypeDefinition df in DataTypeDefinition.GetAll())
                    if (df.DataType.Id == DataTypeId)
                    {
                        dfId = df.Id;
                        break;
                    }
    
                if (dfId == 0)
                    return null;
                else
                    return new DataTypeDefinition(dfId);
            }

    While looping through the Data types, 2 of the data types (df.DataType) seems to be null (why ever?). So I identified them (by outputting the foreach loop and compared to the complete list in backend), opened the missing ones in the backend and just clicked the Save button.

    After that, it worked! 

     

    Best Regards

    Andreas

Please Sign in or register to post replies

Write your reply to:

Draft