Sitecore / Sitecore.Pathfinder

Get started, get far, get happy!
Other
34 stars 12 forks source link

InvalidOperationException: Package not found: Sitecore when run-scc is run #54

Closed dotted closed 7 years ago

dotted commented 8 years ago

I'm trying to build the CleanBlog project using version 0.8.0-alpha as released on npm, however doing so yields this error:

C:\Users\...\Documents\GitHub\Sitecore.Pathfinder\test\CleanBlog>run-scc
scc.cmd(0,0): information SCC3041: Checking project...
items\master\sitecore\content\Home\CleanBlog\NavBar\About.item.xml(19,10,19,15): warning SCC3008: Field contains 'Lorem Ipsum' text: The field "Text" contains the test data text: "Lorem Ipsum...". Replace or remove the text data. [FieldContainsLoremIpsum]
scc.cmd(0,0): information SCC3042: Checks: 39, references: 11, errors: 0, warnings: 1, messages: 0
scc.cmd(0,0): information SCC4015: Writing package exports...
scc.cmd(0,0): information SCC4018: Creating packages...
scc.cmd(0,0): information SCC4019: Created: sitecore.project\build\Sitecore.1.0.0.nupkg (2.282.918 bytes)
scc.cmd(0,0): information SCC4008: Installing packages...
scc.cmd(0,0): error SCC6001: The server returned an error: Serverfejl i programmet '/'.
    Package not found: Sitecore
    Beskrivelse: Der opstod en undtagelse, der ikke blev behandlet, under udførelse af den aktuelle webanmodning. Se staksporingen for at få flere oplysninger om fejlen, og hvor den kom fra i koden.
    Detaljer om undtagelse: System.InvalidOperationException: Package not found: Sitecore
    Kildefejl:
Der blev oprettet en undtagelse, der ikke blev behandlet,  under kørsel af den aktuelle webanmodning. Du kan finde oplysninger om undtagelsens oprindelse og placering ved hjælp af nedenstående staksporing af undtagelser.
    Staksporing:
[InvalidOperationException: Package not found: Sitecore]
    Sitecore.Pathfinder.Packaging.WebsitePackages.WebsitePackageService.InstallOrUpdatePackage(String packageId) +337
    Sitecore.Pathfinder.Controllers.PathfinderInstallPackageController.Index() +2018
    lambda_method(Closure , ControllerBase , Object[] ) +87
    System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters) +229
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters) +35
    System.Web.Mvc.c__DisplayClass15.b__12() +80
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +453
    System.Web.Mvc.ControllerActionInvoker.InvokeActionMethodFilter(IActionFilter filter, ActionExecutingContext preContext, Func`1 continuation) +453
    System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +982
    Sitecore.Mvc.Controllers.SitecoreActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +42
    System.Web.Mvc.c__DisplayClass22.b__1e() +39
    System.Web.Mvc.Async.AsyncResultWrapper.b__0(IAsyncResult asyncResult, Action action) +21
    System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +53
    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +36
    System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +38
    System.Web.Mvc.MvcHandler.b__5(IAsyncResult asyncResult, ProcessRequestState innerState) +44
    System.Web.Mvc.Async.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult) +65
    System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +38
    System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +399
    System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +137
    Versionsoplysninger: Microsoft .NET Framework version:4.0.30319; ASP.NET version:4.6.1073.0

scc.cmd(0,0): information SCC4016: Publishing database...
scc.cmd(0,0): information SCC4014: Database: master
scc.cmd(0,0): information SCC7013: Showing website...
scc.cmd(0,0): information SCC7014:     (if this annoys you, remove the 'show-website' task from the 'build-project:tasks' setting)
Project metrics: 23 items, 4 templates, 5 media files, 4 renderings, 29 files
Time: 1.117ms, Ducats earned: 900

I used SIM to install Sitecore 8.1 update 3 to C:\inetpub\wwwroot\Pathfinder

JakobChristensen commented 8 years ago

Hey Bo

Wow, thanks for trying Pathfinder.

I cannot reproduce this, so let me tell you what I did.

  1. I create a blank directory and ran "npm install sitecore-pathfinder"
  2. I copied scc.cmd from another Pathfinder project (I guess this does the same as your run-scc command).
  3. I installed CleanBlog.
  4. I ran "scc"
  5. Everything worked as expected.

I am curious about the exception "Package not found: Sitecore". When installing, Pathfinder creates a NuGet feed that points back to the project directory. If Pathfinder gets the project directory wrong, it cannot find the package, which would throw this exception.

Is your project directory in a really long path? Did you run run-scc outside the project directory?

dotted commented 8 years ago

I have sitecore-pathfinder installed globally npm i -g sitecore-pathfinder, which is where run-scc comes from, I presume run-scc is generated by npm because of this https://github.com/JakobChristensen/Sitecore.Pathfinder/blob/53ec36b651ebe81492a3bd184faa98f19d8aff27/src/buildfiles/npm/package.json#L11

So I tried the following

  1. Create a blank directory and ran "npm install sitecore-pathfinder"
  2. Downloaded this repo as a zip and extracted CleanBlog into the directory
  3. I ran scc

Same outcome

I forgot to mention this previously, but running scc again I get this error, requiring me to delete the file in question

C:\Users\...\Documents\GitHub\pathfinder-test>scc
scc.cmd(0,0): information SCC3041: Checking project...
items\master\sitecore\content\Home\CleanBlog\NavBar\About.item.xml(19,10,19,15): warning SCC3008: Field contains 'Lorem Ipsum' text: The field "Text" contains the test data text: "Lorem Ipsum...". Replace or remove the text data. [FieldContainsLoremIpsum]
scc.cmd(0,0): information SCC3042: Checks: 39, references: 11, errors: 0, warnings: 1, messages: 0
scc.cmd(0,0): information SCC4015: Writing package exports...
scc.cmd(0,0): information SCC4018: Creating packages...
scc.cmd(0,0): error SCC4020: Failed to create the Nupkg file: Processen kan ikke få adgang til filen 'C:\Users\...\Documents\GitHub\pathfinder-test\sitecore.project\build\Sitecore.1.0.0.nupkg', fordi den bliver brugt af en anden proces.
scc.cmd(0,0): information SCC4008: Installing packages...
scc.cmd(0,0): information SCC4016: Publishing database...
scc.cmd(0,0): information SCC4014: Database: master
scc.cmd(0,0): information SCC7013: Showing website...
scc.cmd(0,0): information SCC7014:     (if this annoys you, remove the 'show-website' task from the 'build-project:tasks' setting)
Project metrics: 23 items, 4 templates, 5 media files, 4 renderings, 29 files
Time: 1.322ms, Ducats earned: 900

The path length to the root folder of the project is 50 characters, so I dont think that is the issue.

JakobChristensen commented 8 years ago

Still no luck reproducing it.

  1. Created blank directory and ran npm i -g sitecore-pathfinder
  2. Ran run-scc new-project to create project and install CleanBlog
  3. Ran run-scc

Everything worked and the website came up.

Next:

  1. Created blank directory and ran npm install sitecore-pathfinder (Pathfinder is still globally installed)
  2. Unzipped CleanBlog to project directory.

Running scc fails, because scc is not found - this is expected. Running run-scc shows the help, because there is no scconfig.json file - this is expected as the project is missing.

Could you try this:

  1. Uninstall and delete every installation of Pathfinder
  2. Download this version of Pathfinder: https://github.com/JakobChristensen/Sitecore.Pathfinder/releases/tag/0.8.302
  3. Unzip it in a empty directory
  4. Add the directory to the system PATH
  5. Create a new blank directory
  6. Run scc new-project and install CleanBlog
  7. Run scc to compile

I assume you have a clean CMS 8.1 installed.

alexshyba commented 8 years ago

I just had the same issue on a clean workstation. Here is what worked for me. Open IIS and find what kind of account runs the app pool. For me it was Network Service. Then grant this account Read, Read & execute and List folder contents permissions on the folder where you have Pathfinder initialized, so the worker process can access the following subfolder with the nuget package: \sitecore.project\build

network service read

Hope this helps!

JakobChristensen commented 7 years ago

I think the new npm installation fixes this issue.