Start a new topic
Answered

Installation with empty Database

 Hello;


I realized some changes on the default Virto Commerce developper version application and now i'm looking to reinstall this solution with an empty database in order to create new store and have my own products before deploying in the Cloud.


I've already followed this tutorial :

To setup database go to ~\src\Extensions\Setup\VirtoCommerce.PowerShell\ folder and run Powershell script below.

without sample data:

setup-database.ps1 -useSample:$false

 

I've created one catalog, one store and now I get this error :

Server Error in '/store' 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: /store/

 

Is there something missing ? Do I need to create items, products etc.. before?

Thank you in advance for your anwsers. Stephane

Edit: I think it's a rooting problem because when I launch the solution from Visual Studio, I have an exception in the StoreHttpModule.cs file:
protected virtual void OnBeginRequest(HttpContext context)
        {
            var store = GetStore(context);

            if (store == null)
            {
                throw new HttpException(404, "Store Not Found");
            }

 GetStore sets the store variable to null: it's why I have this exception.


Then, if I try to understand how this function works, I can see that the function try to know what the DefaultStore is...

The default store, which is "SampleStore", seems to be defined in the web.config. I change with the name of my store but it changes nothing... But finally I change with my Store ID and it works!


BUT... I wanted to have my store in french and to be on my store... the url looks like this:

http://localhost:2359/en-us/electronics


(why electronics? my database was empty except my things...)


If I try to go on my store I have the same error that I had before... HOW CAN I GO DIRECTLY ON THE STORE THAT I DEFINED? (

e.g http://localhost:2359/fr-fr/mystore)


EDIT2: Finally I succeed to configure my store in french. but now I have an other problem: I can't display the product I created before with VirtoCommerce Manager...





Best Answer

Hi, Stephane,
"New products" content is generated dynamically and it's configured separately. 

You can set up it manualy:

  1. create "HomeNewProducts" content place in Settings-> Content places 
  2. create "New Products" dynamic content in Marketing -> Dynamic content 
  3. create "New Products" content publishing in Marketing -> Content publishing 
  4. "New products" should appear where expected. 

You can connect to http://virtocommerce-test.cloudapp.net/ and use the data as a reference.

We'll include this script for "empty database" in upcoming VirtoCommerce release.



We are using script azure-deploy.ps1  for automatic deployment, so you can use it too.

Well problem solved.
Now I need to find how to deploy Virto Commerce with my modifications
Can you tell me if I need to use Azure and Visual Studio or I need to use this same script to do that ?

 

OK I completely managed to deploy the file azure-deploy.ps1 by modifing the value of $common_subscriptionname by "BizSpark".


Now I'm trying to solve issues linked to the database

 

 

05/27/2014 10:24:17 - SQL Database Deployment: In progress
COMMENTAIRES : Setting: Windows Azure MSDN - Visual Studio Ultimate as the default and current subscription. To view other subscriptions use Get-AzureSubscription
05/27/2014 10:24:19 Started SQL Database Setup
05/27/2014 10:24:19 - SQL Database Deployment: setting credentials
05/27/2014 10:24:19 - SQL Database Deployment: setting db context

AVERTISSEMENT : Client Request Id: 'wwwwww-xxxx-cccc-aaa-zzzzzzzzzzzzzz'
New-AzureSqlDatabaseServerContext : Authentication:wwwwww-xxxx-cccc-aaa-zzzzzzzzzzzzzz[Microsoft.SqlServer.MessageText=Login failed for user
'virto'.,Microsoft.SqlServer.MessageSeverity=14,Microsoft.SqlServer.MessageId=18456]
Au caractère C:\Users\ssanchez\Desktop\Migration\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azure-db.ps1:36 : 12
+     $ctx = New-AzureSqlDatabaseServerContext -ServerName $db_servername -Credent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation : (:) [New-AzureSqlDatabaseServerContext], CommunicationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.SqlDatabase.Database.Cmdlet.NewAzureSqlDatabaseServerContext


05/27/2014 10:24:20 - SQL Database Deployment: checking if database exists
Get-AzureSqlDatabase : Impossible de valider l'argument sur le paramètre « ConnectionContext ». L'argument est Null. Spécifiez une valeur valide pour l'argument, puis réessayez.
Au caractère C:\Users\ssanchez\Desktop\Migration\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azure-db.ps1:39 : 32
+     $db = Get-AzureSqlDatabase $ctx -DatabaseName "$db_databasename" -ErrorActio ...
+                                ~~~~
    + CategoryInfo          : InvalidData : (:) [Get-AzureSqlDatabase], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.WindowsAzure.Management.SqlDatabase.Database.Cmdlet.GetAzureSqlDatabase

 

 

Re,
I think I found a solution for this problem :
05/26/2014 11:15:12 - Checking storage account {pixiencevirtocommerce}: Creating new
New-AzureStorageAccount : You MUST specify a certificate. Call Set-AzureSubscription and Select-AzureSubscription
first.
Au caractère C:\Users\ssanchez\Desktop\Migration\vc-community-master2\src\extensions\Setup\VirtoCommerce.PowerShell\azu
re-deploy.ps1:419 : 9
+         New-AzureStorageAccount -StorageAccountName $common_storageaccount -Labe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError : (:) [New-AzureStorageAccount], ArgumentException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.StorageServices.NewAzureStorageAccou
   ntCommand

 

I added on azure-deploy.ps1 line 419 :

Select-AzureSubscription "BizSpark" to select the right Subscription


And with that line a new storage account is created.

But now I have this error :

 

 

05/26/2014 17:15:14 - Checking container {mydeployments}: Finished
05/26/2014 17:15:14 - Checking container {software}: In progress
05/26/2014 17:15:14 - Checking storage account {pixiencevirtocommerce}: In progress
05/26/2014 17:15:14 - Checking storage account {pixiencevirtocommerce}: Creating new
COMMENTAIRES : 17:15:14 - Begin Operation: New-AzureStorageAccount
New-AzureStorageAccount : "An exception occurred when calling the ServiceManagement API. HTTP Status Code: 409. Service Management Error Code: ConflictError. Message: A storage account named
'pixiencevirtocommerce' already exists in the subscription.. Operation Tracking ID: 51532xxxxxxxxxxffad0xx966a66xxxx7081."
Au caractère C:\Users\ssanchez\Desktop\Migration\3\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azure-deploy.ps1:420 : 9
+         New-AzureStorageAccount -StorageAccountName $common_storageaccount -Labe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError : (:) [New-AzureStorageAccount], ServiceManagementClientException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.StorageServices.NewAzureStorageAccountCommand

COMMENTAIRES : 17:15:15 - Completed Operation: New-AzureStorageAccount
COMMENTAIRES : 17:15:15 - Begin Operation: Get-AzureStorageKey
COMMENTAIRES : 17:15:16 - Completed Operation: Get-AzureStorageKey
pixiencevirtocommerce
05/26/2014 17:15:16 - Checking container {software}: Finished


05/26/2014 17:15:16 - SQL Database Deployment: In progress
COMMENTAIRES : Setting: Windows Azure MSDN - Visual Studio Ultimate as the default and current subscription. To view other subscriptions use Get-AzureSubscription
05/26/2014 17:15:19 Started SQL Database Setup
05/26/2014 17:15:19 - SQL Database Deployment: setting credentials
05/26/2014 17:15:19 - SQL Database Deployment: setting db context
AVERTISSEMENT : Client Session Id: '...........-1dad-46e9-b9ba-..........-2014-05-26 15:15:20Z'
AVERTISSEMENT : Client Request Id: '.........-.....-4fa3-......-ef96763a4749'
New-AzureSqlDatabaseServerContext : Authentication:391be3a9-4cf3-4e48-bf95-8a70fd47624c[Microsoft.SqlServer.MessageText=Login failed for user
'virto'.,Microsoft.SqlServer.MessageSeverity=14,Microsoft.SqlServer.MessageId=18456]
Au caractère C:\Users\ssanchez\Desktop\Migration\3\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azure-db.ps1:36 : 12
+     $ctx = New-AzureSqlDatabaseServerContext -ServerName $db_servername -Credent ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation : (:) [New-AzureSqlDatabaseServerContext], CommunicationException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.SqlDatabase.Database.Cmdlet.NewAzureSqlDatabaseServerContext

 

 

 


 

Hello,
my previous issue is solved but now I have problem when i want to create a new storage account :

 

 

05/26/2014 11:15:12 - Checking storage account {pixiencevirtocommerce}: Creating new
New-AzureStorageAccount : You MUST specify a certificate. Call Set-AzureSubscription and Select-AzureSubscription
first.
Au caractère C:\Users\ssanchez\Desktop\Migration\vc-community-master2\src\extensions\Setup\VirtoCommerce.PowerShell\azu
re-deploy.ps1:419 : 9
+         New-AzureStorageAccount -StorageAccountName $common_storageaccount -Labe ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : CloseError : (:) [New-AzureStorageAccount], ArgumentException
    + FullyQualifiedErrorId : Microsoft.WindowsAzure.Management.ServiceManagement.StorageServices.NewAzureStorageAccou
   ntCommand

Get-AzureStorageKey : You MUST specify a certificate. Call Set-AzureSubscription and Select-AzureSubscription first.
Au caractère C:\Users\ssanchez\Desktop\Migration\vc-community-master2\src\extensions\Setup\VirtoCommerce.PowerShell\azu
re-deploy.ps1:429 : 34....

 

 

Do you know how can I resolve this issue please ?


[edit]

I just tried to create this storage account directly from Azure but I still have this problem.

I don't know how and where specify a certificate


I tried to comment the lines 294-297 to see what happen next and i still have a problem with the schemaVersion which seems not valid again.

 

Build Failed
Au caractère C:\PATH\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azure-deploy.ps1:303 : 11
+           throw "Build Failed"
+           ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Build Failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Build Failed

I don't understand what's wrong..

(I can't install this soft : Windows Management Framework 3.0 download link, I'm on W8)

 

Hello Sasha,

yes I'm trying now to deploying it to azure. I checked my azure sdk version and my azure powershell version and if I didn't made a mistake, all is fine.
But when I'm trying to launch the script I got these 3 errors before the script stop.

 

       "C:\PATH\vc-community-master\VirtoCommerce.sln" (build cible) (1) ->
       "C:\PATH\vc-community-master\src\Azure\WorkerRoles\Search\ElasticSearch\ElasticSearc
       h.ccproj" (cible par défaut) (83) ->
       (PreValidateServiceModel cible) ->
         C:\PATH\vc-community-master\src\Azure\WorkerRoles\Search\ElasticSearch\ServiceDefi
       nition.csdef(2,112): error CloudServices051: The XML specification is not valid: L'attribut 'schemaVersion' n'es
       t pas valide - La valeur '2013-10.2.2' n'est pas valide selon son type de données 'http://schemas.microsoft.com/
       ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - Échec de la contrainte Enumeration. [C:\PATH\vc-community-master\src\Azure\WorkerRoles\Search\ElasticSearch\ElasticSearch.ccproj]


       "C:\PATH\vc-community-master\VirtoCommerce.sln" (build cible) (1) ->
       "C:\PATH\vc-community-master\src\Azure\WebRoles\Frontend\CommerceSite\CommerceSite.c
       cproj" (cible par défaut) (82) ->
         C:\PATH\vc-community-master\src\Azure\WebRoles\Frontend\CommerceSite\ServiceDefini
       tion.csdef(2,118): error CloudServices051: The XML specification is not valid: L'attribut 'schemaVersion' n'est
       pas valide - La valeur '2013-10.2.2' n'est pas valide selon son type de données 'http://schemas.microsoft.com/Se
       rviceHosting/2008/10/ServiceDefinition:SchemaVersion' - Échec de la contrainte Enumeration. [C:\PATH\vc-community-master\src\Azure\WebRoles\Frontend\CommerceSite\CommerceSite.ccproj]


       "C:\PATH\vc-community-master\VirtoCommerce.sln" (build cible) (1) ->
       "C:\PATH\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\AzureSch
       eduler.ccproj" (cible par défaut) (79) ->
         C:\PATH\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\Service
       Definition.csdef(2,120): error CloudServices051: The XML specification is not valid: L'attribut 'schemaVersion'
       n'est pas valide - La valeur '2013-10.2.2' n'est pas valide selon son type de données 'http://schemas.microsoft.
       com/ServiceHosting/2008/10/ServiceDefinition:SchemaVersion' - Échec de la contrainte Enumeration. [C:\PATH\vc-community-master\src\Azure\WorkerRoles\Scheduler\AzureScheduler\AzureScheduler.ccproj]

    8 Avertissement(s)
    3 Erreur(s)

Temps écoulé 00:01:05.00
Build Failed
Au caractère C:\PATH\vc-community-master\src\extensions\Setup\VirtoCommerce.PowerShell\azur
e-deploy.ps1:296 : 11
+           throw "Build Failed"
+           ~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : OperationStopped: (Build Failed:String) [], RuntimeException
    + FullyQualifiedErrorId : Build Failed

 

 

The function Get-WindowsAzurePowerShellVersion returns

 

Version : 0.6.19
Name    : Azure
Author  : Microsoft Corporation

 

If you are deploying to azure, that would be the best option. We deploy to azure using included scripts daily. That is how our demo and test environments are deployed. We are investigating that other posts. Typically it has to do with incorrect libraries installed (for example azure sdk 2.3 vs 2.2 required and so on).

And can you tell me what is the best solution to deploy Virto Commerce, now that I incorporated my modifications into the project ?

Is it possible to do it directly via Visual Studio ?

Because I see here there is a problem with the deployment

 

Thanks, the last screenshot was very informative, we'll investigate and let you know.

 I compare your demo version and what I have and I noticed that items in "New Products" area don't go to the same address like I showing you in the attached file.


Maybe I forgot to config something on VirtoCommerce Manager ?

error2.jpg
(284 KB)
Hello,
Yes I tried to debug this. When page load on index this part of code doesn't bug but when I click on one of them I have this error and i don't know why this exception occures..

 

error.jpg
(212 KB)

I've tried reproducing your last issue using latest and even 1.9.732 version code. English and French. But it worked. Have you debugged that line? Any suspicions how this NullReferenceException occures?

euh.. sorry something goes wrong with your solution.

I can display pictures in the "New Products" area but when I click on one of them I get this error :


La référence d'objet n'est pas définie à une instance d'un objet.

Description : Une exception non gérée s'est produite au moment de l'exécution de la requête Web actuelle. Contrôlez la trace de la pile pour plus d'informations sur l'erreur et son origine dans le code.



Détails de l'exception: System.NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.

Erreur source:

Ligne 1 :  @model IEnumerable<string>
Ligne 2 :  
Ligne 3 :  @foreach (var placeName in Model)
Ligne 4 :  {
Ligne 5 :      <div id="@placeName">


Fichier source : c:\PATH\vc-community-master\src\Presentation\FrontEnd\StoreWebApp\Views\Banner\MultiBanner.cshtml Ligne : 3

Trace de la pile:

[NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.]
   ASP._Page_Views_banner_MultiBanner_cshtml.Execute() in c:\PATH\vc-community-master\src\Presentation\FrontEnd\StoreWebApp\Views\Banner\MultiBanner.cshtml:3
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +279
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +124
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +195
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +377
   System.Web.Mvc.<>c__DisplayClass1a.<InvokeActionResultWithFilters>b__17() +32
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +799724
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +799724
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +799724
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +263
   System.Web.Mvc.Async.<>c__DisplayClass25.<BeginInvokeAction>b__22(IAsyncResult asyncResult) +787092
   System.Web.Mvc.<>c__DisplayClass1d.<BeginExecuteCore>b__18(IAsyncResult asyncResult) +28
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult) +65
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult) +51
   System.Web.Mvc.<>c__DisplayClass8.<BeginProcessRequest>b__3(IAsyncResult asyncResult) +42
   System.Web.Mvc.Async.<>c__DisplayClass4.<MakeVoidDelegate>b__3(IAsyncResult ar) +15
   System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult) +51
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +606
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

 

Well it's working perfectly. Thank you very much :)

 

Login or Signup to post a comment