Alfresco 5.0 Community unable to create folders within share - windows

I am trying to deploy Alfresco Community 5.0 on Windows Server 2012 R2, with IIS 8 and I have run into a little bit of a pickle. Currently, everything seems to be functioning as expected except for the creation of folders. I can add files and users, so I'm not really sure where to start.
When I try to create a new folder within the share site I am prompted with "Could not create 'new folder'. Duplicate folder name?" and I am entering a random name.
I checked the alfresco.log file and there is nothing in there.
If you need any extra information let me know.
IIS threw this exception.
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 3/10/2015 9:13:17 AM
Event time (UTC): 3/10/2015 3:13:17 PM
Event ID: 2a27fe7511504646bdc5cf85b4f428c1
Event sequence: 90
Event occurrence: 5
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/1/ROOT-1-130704715600439291
Trust level: Full
Application Virtual Path: /
Application Path: C:\inetpub\wwwroot\
Machine name: WEDNESDAY
Process information:
Process ID: 3352
Process name: w3wp.exe
Account name: IIS APPPOOL\DefaultAppPool
Exception information:
Exception type: HttpException
Exception message: A potentially dangerous Request.Path value was detected from the client (:).
at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)
Request information:
Request URL: http://wednesday/share/proxy/alfresco/api/type/cm:folder/formprocessor
Request path: /share/proxy/alfresco/api/type/cm:folder/formprocessor
User host address: 10.000.00.00
User:
Is authenticated: False
Authentication Type:
Thread account name: IIS APPPOOL\DefaultAppPool
Thread information:
Thread ID: 8
Thread account name: IIS APPPOOL\DefaultAppPool
Is impersonating: False
Stack trace: at System.Web.HttpRequest.ValidateInputIfRequiredByConfig()
at System.Web.HttpApplication.PipelineStepManager.ValidateHelper(HttpContext context)

asp.net 4.0 has quite extensive url validation. When Alfresco creates a folder it uses alfresco/api/type/cm:folder/formprocessor as the url. The validation rejects the use of : in url's so I added a regex function within my asp.net web.config file.
system.web>
httpRuntime requestPathInvalidCharacters="<,>,%,&,\,?" />
/system.web>
All of the other special characters are still getting validated, but I did not include ":" so now the url is allowed through.

Related

CKFinder - 404 Error when attempting an upload

I set my CKFinder/CKEditor integration as follows:
var editor = CKEDITOR.replace('editor11');
CKFinder.setupCKEditor(editor, null, { type: 'Files', currentFolder: '/archive/' });
The CKFinder popup displays and I go to the upload tab and am able to select an image. When I click "Send it to the Server" I get the following error:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure that
it is spelled correctly.
Requested URL: /ckfinder/connector
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET
Version:4.7.2110.0
I get a similar error when I click "Browse Server" on the Image Info tab. I see nothing else in the documentation that is required. Please help me to solve this issue
Edit:
Adding connectorPath fixed it. The path is different on our DEV server than my local machine, where it works already.
CKFinder.setupCKEditor(editor, {
connectorPath: '/brainsbeta/ckfinder/connector'
});

Nuget.Server on Mac OSX

I followed this steps to setup my own nuget server on local machine (Mac)
https://learn.microsoft.com/en-us/nuget/hosting-packages/nuget-server
I got to step 6 and then when i click "here" it gives me the following error
System.Web.HttpException
The resource cannot be found.
Description: HTTP 404.The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Details: Requested URL: /nuget/Packages
Exception stack trace:
at System.Web.StaticFileHandler.ProcessRequest (System.Web.HttpContext context) [0x00094] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/StaticFileHandler.cs:77
at System.Web.DefaultHttpHandler.BeginProcessRequest (System.Web.HttpContext context, System.AsyncCallback callback, System.Object state) [0x0007f] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/DefaultHttpHandler.cs:101
at System.Web.HttpApplication+<Pipeline>d__225.MoveNext () [0x008d4] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpApplication.cs:1335
at System.Web.HttpApplication.Tick () [0x00000] in /private/tmp/source-mono-2017-02/bockbuild-2017-02/profiles/mono-mac-xamarin/build-root/mono-x86/mcs/class/System.Web/System.Web/HttpApplication.cs:927
Please help
I can see two issues in this approach.
Nuget.Server documentation mentions IIS as the web sever; IIS doesn't run on Mac OSX.
And, even if you end up using the native web server of your operating system, you will need WCF support in mono - which looks to be a work in progress.

Calling an MVC3 action from a SQL CLR stored procedure

I'm working on a CLR stored procedure that calls a controller action in an ASP.NET MVC3 application that uses Windows Authentication (everything else is disabled). The Web server is IIS 7.5 running on Windows Server 2008 R2 Standard. The database server is SQL Server 2008 R2 Enterprise Edition. Here is the code of the CLR proc:
[SqlProcedure]
public static void UpdateModels()
{
Uri uri = null;
HttpWebRequest rq;
HttpWebResponse rsp;
Uri.TryCreate("http://testserver/RPM/Configuration/UpdateModels", UriKind.Absolute, out uri);
rq = (HttpWebRequest)HttpWebRequest.Create(uri);
rq.Method = WebRequestMethods.Http.Get;
rsp = (HttpWebResponse)rq.GetResponse();
}
I was able to deploy the assembly to SQL Server without problem, but when I run it, I get the following error:
Msg 6522, Level 16, State 1, Procedure UpdateModels, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "UpdateModels":
System.Net.WebException: The remote server returned an error: (401) Unauthorized.
System.Net.WebException:
at System.Net.HttpWebRequest.GetResponse()
at StoredProcedures.UpdateModels()
.
This occurs when I call the SP from a SQL Agent job (run under my credentials), when I EXEC it from a SSMS query window (again, my credentials), or any other method I've thought to try. I am an authorized user of the Web application and able to call that controller method just fine from the application itself.
If I change the URL to be just "http://testserver", it runs fine (of course, it doesn't do anything), but if I add "RPM" to the URL, it fails, so it seems the problem is with the application itself, not with the server or its default site. Also, if I enable anonymous auth, it works, so somehow the Windows credentials are not being passed to the site. Checking the log confirms this:
2012-02-23 12:51:33 10.1.1.1 GET /RPM/Configuration/UpdateModels - 80 - 10.2.2.2- 302 0 0 218
The credentials are not being passed. I've tried using impersonation within the CLR SP code, but that has not helped. As I'm sure is obvious, I'm pretty new at this stuff and am probably doing something daft. If someone could set me on the right course, I'd be grateful!
TIA,
Jeff
Well, as I feared, I was doing something daft. Turns out impersonation was the answer, but I simply needed to set the impersonation level:
rq.ImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
before calling the GetResponse method. After doing that, the credentials supplied were passed to the MVC3 controller just as I'd originally expected.
Thought I'd post this just in case anyone else struggles with it the way I did.
Jeff

'DefaultAppPool' suffered a fatal communication error with the World Wide Web Publishing Service

I am getting Event Log entries every time I access the site:
Event Type: Error
Event Source: VsJITDebugger
Event Category: None
Event ID: 4096
User: NT AUTHORITY\NETWORK SERVICE
Computer: COMPUTER-02
Description:
An unhandled Microsoft .NET Framework exception occurred in w3wp.exe [2908]. Just-In-Time debugging this exception failed with the following error: Debugger could not be started because no user is logged on.
Check the documentation index for 'Just-in-time debugging, errors' for more information.
Data:
0000: 02 00 5c 80 ..\
System Logs
Event Type: Error
Event Source: W3SVC
Event Category: None
Event ID: 1002
Date: 28/03/2011
Time: 17:49:28
User: N/A
Computer: COMPUTER-02
Description:
Application pool 'DefaultAppPool' is being automatically disabled due to a series of failures in the process(es) serving that application pool.
Application Log
Event Type: Warning
Event Source: W3SVC
Event Category: None
Event ID: 1011
Date: 28/03/2011
Time: 17:49:28
User: N/A
Computer: COMPUTER-02
Description:
A process serving application pool 'DefaultAppPool' suffered a fatal communication error with the World Wide Web Publishing Service. The process id was '3724'. The data field contains the error number.
Data:
0000: 6d 00 07 80 m..
I have also followed the advice of Microsoft's Support site without luck. The Network Service account didn't have any problems accessing the registry.
I need to run the site in IIS6 (instead of IIS Express 7.5) as the site runs ASP as well as ASP.NET I need the wildcard mapping for authentication in ASP.
I have completely run out of ideas, as the site was fine in ASP.NET 3.5 (CLR v2...), but this upgrade has completely messed up by debugging.
Any help will be much appreciated.
You will need WinDbg (Debugging Tools for Windows) and DebugDiag.
Install DebugDiag and WinDbg
Ensure you have copied the related framework's SOS.dll to the WinDbg directory.
Add a rule to catch IIS/COM+ processes
On first exceptions, create a full user dump. Limit of 10
Open the website and look at look at DebugDiag, you should find it starting to take full dumps.
Once you have a few memory dumps, load WinDbg and click File->Open Crash Dump and load one of the memory dump.
Type .load sos
Type !clrstack
You will get a stack trace of the error like:
0:016> .load sos
0:016> !clrstack
PDB symbol for clr.dll not loaded
OS Thread Id: 0xa60 (16)
Child SP IP Call Site
01d2eb5c 7c81a251 [HelperMethodFrame: 01d2eb5c] System.Diagnostics.Debugger.LaunchInternal()
01d2ebac 7a0e0166 System.Diagnostics.Debugger.Launch()*** WARNING: Unable to verify checksum for mscorlib.ni.dll
*** ERROR: Module load completed but symbols could not be loaded for mscorlib.ni.dll
01d2ebd8 04470176 ebiz.Global.Application_Start(System.Object, System.EventArgs)
01d2f1f8 791421bb [DebuggerU2MCatchHandlerFrame: 01d2f1f8]
01d2f1c4 791421bb [CustomGCFrame: 01d2f1c4]
01d2f198 791421bb [GCFrame: 01d2f198]
01d2f17c 791421bb [GCFrame: 01d2f17c]
01d2f3a0 791421bb [HelperMethodFrame_PROTECTOBJ: 01d2f3a0] System.RuntimeMethodHandle._InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.SignatureStruct ByRef, System.Reflection.MethodAttributes, System.RuntimeType)
01d2f41c 79b3d689 System.RuntimeMethodHandle.InvokeMethodFast(System.IRuntimeMethodInfo, System.Object, System.Object[], System.Signature, System.Reflection.MethodAttributes, System.RuntimeType)
01d2f470 79b3d37c System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo, Boolean)
01d2f4ac 79b3bfed System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
01d2f4d0 79b43284 System.Reflection.MethodBase.Invoke(System.Object, System.Object[])
01d2f4dc 67894f4d System.Web.HttpApplication.InvokeMethodWithAssert(System.Reflection.MethodInfo, Int32, System.Object, System.EventArgs)*** WARNING: Unable to verify checksum for System.Web.ni.dll
*** ERROR: Module load completed but symbols could not be loaded for System.Web.ni.dll
01d2f500 678951cb System.Web.HttpApplication.ProcessSpecialRequest(System.Web.HttpContext, System.Reflection.MethodInfo, Int32, System.Object, System.EventArgs, System.Web.SessionState.HttpSessionState)
01d2f550 67b34175 System.Web.HttpApplicationFactory.FireApplicationOnStart(System.Web.HttpContext)
01d2f564 672bfe1c System.Web.HttpApplicationFactory.EnsureAppStartCalled(System.Web.HttpContext)
01d2f59c 672bfd3d System.Web.HttpApplicationFactory.GetApplicationInstance(System.Web.HttpContext)
01d2f5ac 672fbf28 System.Web.HttpRuntime.ProcessRequestInternal(System.Web.HttpWorkerRequest)
01d2f5e0 672fbccd System.Web.HttpRuntime.ProcessRequestNoDemand(System.Web.HttpWorkerRequest)
01d2f5f0 672fb2cd System.Web.Hosting.ISAPIRuntime.ProcessRequest(IntPtr, Int32)
01d2f5f4 6791c30c [InlinedCallFrame: 01d2f5f4]
01d2f668 6791c30c DomainNeutralILStubClass.IL_STUB_COMtoCLR(Int32, Int32, IntPtr)
01d2f7fc 791425a1 [GCFrame: 01d2f7fc]
01d2f86c 791425a1 [ContextTransitionFrame: 01d2f86c]
01d2f8a0 791425a1 [GCFrame: 01d2f8a0]
01d2f9f8 791425a1 [ComMethodFrame: 01d2f9f8]
For me anyway, you can see that the Debugger.Launch() is right at the top, and low and behold, my code had it in. It seems that IIS doesn't like that at all if it is your first line of code!
If you are not familiar with WinDbg, you can still extract a lot of information from the dumps. You already have dumps created by DebugDiag. Launch VS, File -> Open -> File (Ctrl + O), select the .dmp file. VS2010 will than display couple of options to debug -- Mixed mode or Native Only. Choose Mixed mode, open threads window, identify thread that threw exception, look at the call stack. Sometimes you get to local variables for the thread, but don't count on that too much, as data might not be correct.

Sharepoint 2010 Client Object Model Remote Access via HTTPS

I was encouraged to learn that the Sharepoint 2010 Client Object Model essentially wraps remote calls to the server. So, I copied the Microsoft.Sharepoint.Client.Silverlight.dll and Microsoft.Sharepoint.Client.Silverlight.Runtime.dll from my Sharepoint 2010 server to my development machine (without Sharepoint). I assumed the Silverlight code I tested on the Sharepoint 2010 server would also work on my development machine. Naturally, I don't use the "ApplicationContext.Current.Url" because I am not executing in Sharepoint, so I manually add sharepoint server name as follows (kept anonymous for the post):
//ClientContext context = new ClientContext(ApplicationContext.Current.Url);
ClientContext context = new ClientContext("https://[servername]");
_web = context.Web;
context.Load(_web);
context.Load(_web.Lists);
context.ExecuteQueryAsync(new ClientRequestSucceededEventHandler (OnRequestSucceeded), new ClientRequestFailedEventHandler(OnRequestFailed));
When I execute the code, I am prompted by a Windows Authentication window (Sharepoint is configured to use Windows Authentication), I add my domain/user and password. However, I am getting the following error:
Note: I was able to get Sharepoint 2010 web services working given a similar error by changing the binding security mode="Transport" and including a clientAccessPolicy.xml file on the Sharepoint root website. Do I need to configure another Sharepoint directory for thje Client Object Model endpoint?
Exception {System.Security.SecurityException ---> System.Security.SecurityException: Security error.
at System.Net.Browser.BrowserHttpWebRequest.InternalEndGetResponse(IAsyncResult asyncResult)
at System.Net.Browser.BrowserHttpWebRequest.<>c__DisplayClass5.b__4(Object sendState)
at System.Net.Browser.AsyncHelper.<>c__DisplayClass2.b__0(Object sendState)
--- End of inner exception stack trace ---
at System.Net.Browser.AsyncHelper.BeginOnUI(SendOrPostCallback beginMethod, Object state)
at System.Net.Browser.BrowserHttpWebRequest.EndGetResponse(IAsyncResult asyncResult)
at Microsoft.SharePoint.Client.ClientRequest.ExecuteQueryGetResponseAsyncCallback(IAsyncResult asyncResult)} System.Exception {System.Security.SecurityException}
Please look in to the below blog post, you need to add clientaccesspolicy.xml file in your sharepoint website root folder.
http://vangalvenkat.blogspot.com/2011/08/sharepoint-2010-getting-list-item.html
Aha, I found it. You can set the security on the client context to use the default windows authentication like so:
using (Microsoft.Sharepoint.Client.ClientContext ctx = new Microsoft.Sharepoint.Client.ClientContext("http://sharepointserver")){
ctx.AuthenticationMode = Microsoft.Sharepoint.Client.ClientAuthenticationMode.Default
}
This should also prevent any windows authentication pop-ups

Resources