DNN 4.9 ... Intermittent error while uploading PDF files - asp.net

I get intermittent "Object reference is not set to an instance of an object" errors when uploading PDF files in FCKEditor in DNN 4.9.
Here's the error:
AssemblyVersion: 04.09.00 AbsoluteURL:
/.../Providers/HtmlEditorProviders/Fck/fcklinkgallery.aspx
UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; .NET CLR
1.1.4322; .NET CLR 2.0.50727; IEMB3; IEMB3) InnerException: Object reference not set to an instance of an object. FileName:
FileLineNumber: 0 FileColumnNumber: 0 Method:
DotNetNuke.UI.UserControls.UrlControl.cmdSave_Click StackTrace:
Message: DotNetNuke.Services.Exceptions.PageLoadException: Object
reference not set to an instance of an object. --->
System.NullReferenceException: Object reference not set to an instance
of an object. at
DotNetNuke.UI.UserControls.UrlControl.cmdSave_Click(Object sender,
EventArgs e) at System.Web.UI.WebControls.LinkButton.OnClick(EventArgs
e) at System.Web.UI.WebControls.LinkButton.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.WebControls.LinkButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String
eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler
sourceControl, String eventArgument) at
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) at
System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
--- End of inner exception stack trace ---
The error comes and goes, file size doesn't seem to matter, last time i got it after uploading a couple of 1MB files, the third file (600kB) gave me an error.
Please help!

I have noticed this on a number of sites with the FCK provider that is included in 4.9.0 and later versions of DotNetNuke.
At this time I am not aware of any way to "Fix" it, as I have not pinpointed exactly what is causing the error.

Related

ASP.NET / IIS loading X509Certificate.LoadCertificateFromFile

I am trying to load a certificate in a class that is hosted in IIS.
The code that i used is:
X509Certificate2 privateCertificate = new X509Certificate2(#"C:\Temp\file.pfx", "mycertpass");
Later on in my code when privateCertificate is used it causes a problem on the production environment. This problem does not occur on the local environment, the exception is as follows:
Exception information:
Exception type: CryptographicException
Exception message: An internal error occurred.
at System.Security.Cryptography.CryptographicException.ThrowCryptographicException(Int32 hr)
at System.Security.Cryptography.X509Certificates.X509Utils._LoadCertFromFile(String fileName, IntPtr password, UInt32 dwFlags, Boolean persistKeySet, SafeCertContextHandle& pCertCtx)
at System.Security.Cryptography.X509Certificates.X509Certificate.LoadCertificateFromFile(String fileName, Object password, X509KeyStorageFlags keyStorageFlags)
at Medapp.PaymentResponse.CreateRepository()
at Medapp.PaymentResponse.Page_Load(Object sender, EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I thought it might be a permission on folder problem however i have added "everyone" with full access temporarily and this did not solve the problem either.
Any ideas would be appreciated.
Make sure C:\Temp\file.pfx path is accesible. probably you want to test Server.MapPath("~/folder/" + filename).
Also check out the identity of your app pool and make sure that the Load user profile option is turned on, otherwise the crypto susbsystem won't work.
Try specifying X509KeyStorageFlags
var certificate = new X509Certificate2(KeyFilePath, KeyFilePassword,
X509KeyStorageFlags.MachineKeySet |
X509KeyStorageFlags.PersistKeySet |
X509KeyStorageFlags.Exportable);

userprincipal.findbyidentity an operations error occurred

Okay so, I have been given the responsibility to migrate a website with multiple applications to another server. That migration went well (all applications working). However, the performance of that new server was sub par (whole other story). We decided to migrate it again. This time everything is working very well-- except one application.
It worked just fine on the first and second IIS servers, but is refusing to cooperate this time around.
I've mirrored all the config settings that I could find from the working server:
windows authentication enabled: check
Impersonation disabled: check
applicationpool settings match: check
I just don't know what I'm missing; why would it work on one server, but not the other.
An operations error occurred.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Runtime.InteropServices.COMException: An operations error occurred.
Source Error:
Line 9: Dim myUsername As String = Right(User.Identity.Name, Len(User.Identity.Name) - InStr(User.Identity.Name, "\"))
Line 10: Dim ctx = New PrincipalContext(ContextType.Domain)
Line 11: Dim myUser = UserPrincipal.FindByIdentity(ctx, myUsername)
Line 12: hfValid.Value = "false"
Line 13: For Each gp As GroupPrincipal In myUser.GetAuthorizationGroups
Source File: D:\mghnet1\isOnCall\Default.aspx.vb Line: 11
COMException (0x80072020): An operations error occurred
System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) +378142
System.DirectoryServices.DirectoryEntry.Bind() +36
System.DirectoryServices.DirectoryEntry.get_AdsObject() +31
System.DirectoryServices.PropertyValueCollection.PopulateList() +26
System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) +49
System.DirectoryServices.PropertyCollection.get_Item(String propertyName) +150
System.DirectoryServices.AccountManagement.PrincipalContext.DoLDAPDirectoryInitNoContainer() +1114
System.DirectoryServices.AccountManagement.PrincipalContext.DoDomainInit() +37
System.DirectoryServices.AccountManagement.PrincipalContext.Initialize() +112
System.DirectoryServices.AccountManagement.PrincipalContext.get_QueryCtx() +31
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithTypeHelper(PrincipalContext context, Type principalType, Nullable`1 identityType, String identityValue, DateTime refDate) +14
System.DirectoryServices.AccountManagement.Principal.FindByIdentityWithType(PrincipalContext context, Type principalType, String identityValue) +73
System.DirectoryServices.AccountManagement.UserPrincipal.FindByIdentity(PrincipalContext context, String identityValue) +28
_Default.Page_Load(Object sender, EventArgs e) in D:\mghnet1\isOnCall\Default.aspx.vb:11
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Version Information: Microsoft .NET Framework Version:2.0.50727.5466; ASP.NET Version:2.0.50727.5456
Please help, none of the other forum posts I've found have posted solutions that work for me.

Exception loading CustomMeta from Tridion Broker Service (2009 SP1)

I am trying to load some Custom Meta from a component which is published into the Tridion Broker.
This is 2009 SP1
I can see the component in the Custom_Meta table with a query like:
SELECT * FROM [Tridion_Broker].[dbo].[CUSTOM_META] WHERE ITEM_ID = 204221
However using the below code, I get a Java Runtime exception on the line where I do GetMeta. I have noticed that if my queryStringId is a proper TCM ID then it will throw the excpetion but if I just put the item Id it will return null.
string queryStringId = HttpUtility.UrlDecode(Request.QueryString["component_uri"]);
string pageId = ((BasePage) Page).PageTcmId;
int publicationId = int.Parse(pageId.Split(':')[1].Split('-')[0]);
using (var cmf = new ComponentMetaFactory(publicationId))
{
IComponentMeta cm = cmf.GetMeta(queryStringId);
if(cm != null)
{
VideoId = cm.CustomMeta.GetValue("video_url").ToString();
}
else
{
litMessage.Visible = true;
}
}
Stack trace:
[RuntimeException]
Codemesh.JuggerNET.NTypeValue.Throw(Int64 inst) +351
Codemesh.JuggerNET.JavaClass.ThrowTypedException(Int64 inst) +1278
Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, JavaMethodArguments args) +551
Codemesh.JuggerNET.JavaMethod.CallObject(JavaProxy jpo, Type declaredType, Boolean bLeaf, JavaMethodArguments jargs) +50
Com.Tridion.Meta.ComponentMetaFactory.GetMeta(Int32 componentId) +118
Tridion.ContentDelivery.Meta.ComponentMetaFactory.GetMeta(Int32 componentId) +16
ASP._controls_video_ascx.Page_Load(Object sender, EventArgs args) in c:\Inetpub\wwwroot\borland\us\_controls\Video.ascx:18
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +50
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Control.LoadRecursive() +141
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +627
Update
I have looked in the Broker log with the log enabled on "info" level and am seeing nothing after "Tridion Broker is enabled". Is this a configuration or DLL problem? It looks like the CD is not calling the service at all?
Update 2
I have tried a lot of things and still no help. It's like the code is not able to communicate with the JVM, however I can see the JVM being started in the event log.
Are you using Java 1.6? I think you may be using the JDBC driver is for Java 1.5, if so download the latest driver from here
Also double check all your bindings in broker config!
Typically when I had this kind of error, it was because one of the following:
the Java run-time was not installed or available to the web-app (from previous comments I see this is not the case for you). Have you checked the event viewer (either Tridion or Tridion Content Manager) for errors? Something like 'Unable to locate JVM'...
missing JAR - a Tridion or 3rd party JAR is missing from your classpath (which could be under your webroot/bin/lib);
configuration error (Tridion config is wrong, somewhere in webroot/bin/config);
missing license file (check the webroot/bin/config/cd_licenses.xml or maybe your config files point to another cd_licenses.xml, which might not be available or accessible to the web app app-pool user). A missing license is maybe the trickiest. All you see in the log is a subtle mention stating that due to missing/expired license, the Broker has reverted to 'file system'. This means no communication with the CD DB will be made -- for Custom meta this is a no go;
The last 3 errors will be somewhat present in a log file. So make sure you have the log level debug enabled and look for any stack traces in the cd_core and cd_broker logs.
Last but not least, make sure your website app-pool is unique to the Tridion website (do not reuse in other website). Check the .net version used (recommend 4.0) and check the user running it (recommend Network Service).

ERROR MESSAGE: The state information is invalid for this page and might be corrupted (Invalid viewstate)

I have two servers on IIS6 where load balancing is done by a load balancing hardware. When a response is provided Server 1 and the postback is handled by Server 2 it always gets an error The state information is invalid for this page and might be corrupted and underneath Invalid viewstate on almost every postback when requests are handled by alternative servers. If I turn off one of the server then it seems to be working fine.
I have checked the decryptionKey and validationKey are both exactly same on the both server deployment, and also wth enableEventValidation="false" and enableViewStateMac="false". There was no luck with all sorts of solutions available provided by Google :P
Please check the stack trace below where exception occurs at HiddenFieldPageStatePersister.Load() followed by Page.LoadPageStateFromPersistenceMedium().
[ViewStateException: Invalid viewstate.
Client IP: 192.168.5.21
Port: 60042
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:2.0.1) Gecko/20100101 Firefox/4.0.1
ViewState: {VIEWSTATE DATA}
[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.]
System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +118
System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +13
System.Web.UI.HiddenFieldPageStatePersister.Load() +222
System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +107
System.Web.UI.Page.LoadAllState() +43
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6230
System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +247
System.Web.UI.Page.ProcessRequest() +79
System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +23
System.Web.UI.Page.ProcessRequest(HttpContext context) +111
OrderJourneyDefault.ProcessRequest(HttpContext context) in C:\inetpub\wwwroot\x\Default.aspx.cs:350
ASP.toj_application_orderjourney_default_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\82a64fa9\62e4fa0\App_Web_31vcm2al.0.cs:0
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +406
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +76
NOTE: There's no AJAX/Javascript related things to mess up my application.
Thanks in advance.
Munim

ASP.NET: accessdb odbc - when getting an exception, how can i see the full stack trace?

Using ASP.NET as programming language on IIS Server.
the Database is access and i connect to the database using ODBC.
when i fill some form in the website and press submit i get an exception:
Server Error in '/' Application.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.
and stack trace is:
site.modGlobal.ExecuteSQL(String sqlStr, OdbcConnection& dbcon) +128
site.orderprd.imgbtnNextOrder_Click(Object sender, ImageClickEventArgs e) +3951
System.Web.UI.WebControls.ImageButton.OnClick(ImageClickEventArgs e) +86
System.Web.UI.WebControls.ImageButton.RaisePostBackEvent(String eventArgument) +115
System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent (String eventArgument) +7
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +11
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +33
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1746
this is not a website that i wrote so i cannot guess where the query was executed.
how can i get a more complete stack trace in order to pinpoint the location this command was executed ?
The stacktrace seems quite explicit:
site.modGlobal.ExecuteSQL(String sqlStr, OdbcConnection& dbcon) +128
site.orderprd.imgbtnNextOrder_Click(Object sender, ImageClickEventArgs e) +3951
Those lines should give you all the information you need.

Resources