Cannot create a file when that file already exists.

Jan 10, 2016 at 4:38 PM
Hello,
I am new to this module and I intend to get more familiar with it. At the moment I am just trying to install the module and the first app. On dnn 7.4.2 new install with 2sxc 8.0.12.

Got these blocking issues:
  1. Installed the 2sxc extension, apparently ok (successful log messages), but after adding either App or Content on the page there's an upgrade button to push. Doing so leads to the error (in the log): "Cannot create a file when that file already exists."
  2. Installing the Faq demo cannot be done because it does not have a manifest. How to proceed?
Perhaps I am missing the detailed install manual and I am doing things in the wrong way?

Regards

Franco
Coordinator
Jan 11, 2016 at 2:08 PM
Basically this should all work fearly easily. The "pls update" on install message is unsexy but we haven't managed to get around to removing it yet.

Can you check the site-log (admin > events) what file is conflicted?

Manifest: I'm not sure what you're doing, but let's make sure you don't see the upgrade messages any more first...
Jan 11, 2016 at 3:44 PM
Hi,
Unfortunately I cannot say what file it is. Here is the stack trace:

InnerMessage:Cannot create a file when that file already exists.
InnerStackTrace:
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.__Error.WinIOError()
at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
at ToSic.SexyContent.SexyContentModuleUpgrade.set_IsUpgradeRunning(Boolean value)
at ToSic.SexyContent.SexyContentModuleUpgrade.UpgradeModule(String version)
at ToSic.SexyContent.SexyContentModuleUpgrade.FinishAbortedUpgrade()
at ToSic.SexyContent.SexyViewContentOrApp.EnsureUpgrade(Panel pnlError)
at ToSic.SexyContent.View.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Developer
Jan 13, 2016 at 7:03 AM
I can't reproduce this error with DNN 7.4.2 and 2sxc 8.0.12. Does the same error occur when you click the button again after reloading the page? Please restart the application and then click the button again.
Jan 13, 2016 at 9:25 AM
Yes, I get the same trying after those operations (tools - clear cache and tools - recycle the application domain).
Jan 17, 2016 at 11:42 PM
I am getting the same issue installing 8.0.12 on DNN 7.4.2. Note I am upgrading from 2sxc 7.22. In my 2sxc folder I have a couple custom apps but the rest are stock content and apps from your GettingStarted zip.

I get the error when I click "Finish Upgrade".

My stacktrace is exactly the same as fprati.
Jan 18, 2016 at 5:16 PM
Hi there,

I've installed 2sxc a lot of times in many DNN versions with no problem. I've been upgrading versions since version 6, everythink ok.
But now I'm trying to install version 8 on a clean DNN installation, both versions 7 or 8, and I get that same "Module upgrade did not complete. Please click the following button to finish the upgrade: Finish Upgrade" error. My error trace is identical to the one from fprati.

This is driving me nuts, specially because I'm not upgrading... :-|
Coordinator
Jan 18, 2016 at 5:20 PM
Sorry about that. Just press the upgrade, then after it comes again, go back and refresh..

It's something to prevent a more complex mistake, but seems to not always show correctly when it's done.
Coordinator
Jan 18, 2016 at 5:21 PM
...just realized this was already suggested.

Anything special about the setup? Azure? SQL-Version, anything?
Jan 18, 2016 at 5:49 PM
2sicDev wrote:
...just realized this was already suggested.

Anything special about the setup? Azure? SQL-Version, anything?
Not in my case. Same serverin which 2sxc has been working previously. Same error with DNN7 on SQL 2008 and DNN8 on SQL 2012. I've tried to install 2sxc versions 8.0.8 to 8.0.12 with the same result.
Jan 18, 2016 at 6:10 PM
In my case it's Windows 2012 Standard running DNN with SQL Server 2012. Everything is running on the same server. Plesk 11 is involved on the UI management side.
Jan 18, 2016 at 6:16 PM
Upgrade: after several cycles (maybe 2, 3 or more) pressing the Upgrade button, it seems to be working now. Tested both on DNN7 & DNN8.
I can't remember this erratic behavior when installing 2sxc7 or upgrading it to 2sxc8
Jan 18, 2016 at 7:18 PM
OK very interesting Perezandres. I was working on another site just now and did an install of 2sxc 7.2.3. I saw the same behavior there as when I installed 2sxc 8.0.12 on my other site. Same error in the log. Only this time I hit 'back' after the critical error and then Finish Upgrade. After three total presses it finished.

I was just coming on here to report the behavior and see that you successfully got 8.0.12 to install the same way. I am going to try my 8.0.12 site now. Ha! That worked. 3rd or 4th button press in a row does the trick.

I think we've all learned something here today. Perseverance pays off. :) (Gal 6:9) ;)
Jan 19, 2016 at 12:38 PM
I've been doing several tests since yesterday and I still don't have a stable 2sxc installation. For instance, I get a "reference not set to an instance of an object" error when trying to edit the template, but only if web is switched to spanish!
Jan 19, 2016 at 10:39 PM
Hi Perezandres,

I had a different issue where I was getting an exception whenever I tried to turn on a page's localization so wonder if it's related to your issues.

I solved the issue when I noticed that DNN failed to properly set up the URLs for the base languages and mark which ones were primary. For example:

mywebsite.com en-US
mywebsite.com/es-es es-ES
mywebsite.com/es-mx es-MX

Under Admin > Site Settings > Advanced > Site Aliases I had to make sure the languages were properly set and then I mark all those languages as primary.

I believe that's the correct way to do it. At least that stopped the exceptions from happening.

Full disclosure I am still having trouble getting languages to appear properly but I am going to follow that up on another thread.
Coordinator
Jan 20, 2016 at 7:52 AM
Please start a new thread with the language issues to not confuse future readers. I'll give my input there.
Jan 20, 2016 at 6:22 PM
Alright, yeah we were naughty and started switching the subject. So back to the subject.

I just did a fresh install of DNN 7.4.2 and 2sxc 8.0.12.

I then dropped 2sxc Content on a page.

It gave me the Finish Upgrade button.

When I clicked it I got the critical error reported on this page.

I hit back on the browser and hit Finish Upgrade again.

I ended repeating that process 4 more times and got the critical error each time.

On the fifth press it did NOT give the error.

On the sixth 2sxc was fully installed.

So perseverance.

Rock on.
Coordinator
Jan 21, 2016 at 12:52 PM
Just an info for all involved.

2sxc must run some code AFTER installing and there is no guarantee (in DNN) that it doesn't get stopped at some point. So when the page loads, it compares an installation status version to check if it's the installed DLL version. If it isn't - it will show that message.

I'm not 100% sure why it sometimes appears and sometimes not. My guess is, that, either the install is still running in the background - but pages are already loading - OR that certain PCs (especially dev) have a short timeout configured so the scripts cannot finish.

Love from CH (that's the Helvetic Confederation = Switzerland)
Daniel
Jan 21, 2016 at 1:36 PM
I confirm the installation finally works after a couple of attempts as explained by perezandres :)
Apr 6, 2016 at 9:47 AM
Edited Apr 6, 2016 at 9:48 AM
I have big problems to complete upgrade, I get this error in event viewer, I have DNN 8.0.1 and 2sxc 8.03.07 installed

AbsoluteURL:/DesktopModules/2sxc/API/view/module/finishinstallation

DefaultDataProvider:DotNetNuke.Data.SqlDataProvider, DotNetNuke

ExceptionGUID:0749ac20-9937-44e0-bade-126f67486151

AssemblyVersion:

PortalId:-1

UserId:-1

TabId:-1

RawUrl:

Referrer:

UserAgent:

ExceptionHash:pkDULB068FyaQI68M4cfew==

Message:An error occurred while executing the request. Please consult the event log for details.

StackTrace:

InnerMessage:Cannot create a file when that file already exists.

InnerStackTrace:

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.File.InternalMove(String sourceFileName, String destFileName, Boolean checkHost)
at ToSic.SexyContent.Installer.set_IsUpgradeRunning(Boolean value) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer.cs:line 266
at ToSic.SexyContent.Installer.UpgradeModule(String version) in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer.cs:line 141
at ToSic.SexyContent.Installer.FinishAbortedUpgrade() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\SexyContent\Installer.cs:line 179
at ToSic.SexyContent.ViewAPI.ModuleController.FinishInstallation() in C:\Projects\2SexyContent\Web\DesktopModules\ToSIC_SexyContent\WebApi\ViewAPI\ModuleController.cs:line 316
at lambda_method(Closure , Object , Object[] )
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.b__9(Object instance, Object[] methodParameters)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary2 arguments, CancellationToken cancellationToken)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Tracing.ITraceWriterExtensions.d__18
1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Tracing.ITraceWriterExtensions.d__18`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Filters.AuthorizationFilterAttribute.d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Http.Controllers.ExceptionFilterResult.d__0.MoveNext()
Coordinator
Apr 14, 2016 at 9:11 AM
@Nekdahl - did you try the basics like syncing file system?

I'm also assuming this is only about some kind of log files - please move the /desktopmodules/...2sxc.../upgrade/log files to somewhere, just so it's clean for now
Coordinator
Apr 16, 2016 at 9:06 PM
Just an FYI to all: I just spent a night refactoring the installation routines and found 2 very important glitches which could have caused your issues. Please download the newest release 08.04.00h from github and give it a try. Everything should be much faster, the logging during installation more detailed, and all known bugs should be gone :).

Hope you love it :)
https://github.com/2sic/2sxc/releases