andrerod / cspack

CsPack Library for node.js
1 stars 1 forks source link

[cspack] Error in uploading package.cspkg for the blobuploader test app via web portal #10

Open amarzavery opened 11 years ago

amarzavery commented 11 years ago

Reopening issue#841 from azure-sdk-node https://github.com/WindowsAzure/azure-sdk-for-node/issues/841

Parent Issue #763 https://github.com/WindowsAzure/azure-sdk-for-node/issues/763

Node worker role Blobuploader App with vmsize = Medium

Test fails. I get an error : Validation Errors: Error validating the .cscfg file against the .csdef file. Severity:Error, message:Setting 'AZURE_STORAGE_ACCOUNT' for role 'WorkerRole1' specified in the service configuration file is not declared in the service definition file.,Error validating the .cscfg file against the .csdef file. Severity:Error, message:Setting 'AZURE_STORAGE_ACCESS_KEY' for role 'WorkerRole1' specified in the service configuration file is not declared in the service definition file. The long running operation tracking ID was: 09760d0d30484374bc7c19721795c187.

Attaching the ServiceDefinition and ServiceConfiguration.cloud.cscfg files.

Steps to reproduce this issue:

  1. Open the azure powershell as an administrator
  2. New-AzureServiceProject - ServiceName blobtestfriday
  3. Cd blobtestfriday
  4. Add-AzureNodeWorkerRole
  5. cd to WorkerRole directory
  6. Go to: \bpdfiles01\commonshare\markcowl\Node.js\TestApps\blobuploader and copy all the files in the worker role directory
  7. npm install
  8. Change the directory tot he service directory
  9. Edit the following files: A. ServiceDefinition.csdef i. Add Configuration Settings node after Startup and before Endpoints ` ` ii. Add the following environment variables inside the Environment node ` ` B. ServiceConfiguration.Cloud.cscfg i. Add ConfigurationSettings node inside the Role Node ` ` C. ServiceConfiguration.Local.cscfg i. Add ConfigurationSettings node inside the Role Node ` `
  10. Start-AzureEmulator A. Verify the blobuploader page at http://localhost:81
  11. Publish-AzureServiceProject This will publish the service in the cloud. Check the link http://.cloudapp.net to see the blob uploader page
  12. Remove-AzureService -force to delete the service

    Steps from here onwards give error

  13. azure service project package blobtestfriday -v
  14. package.cspkg is generated
  15. Log on to the web portal to create a new cloud service and upload the above generated package.cspkg A. New->Compute->CloudService->CustomCreate i. Name/url ii. Region affinity group iii. Deploy a cloud service package --> next B. Publish your cloud service i. Deployment name ii. Package - browse file (package.cspkg) iii. Configuration - browse file (ServiceConfiguration.Cloud.cscfg) iv. Production Environment v. Deploy even if one or more instances vi. Start Deployment This last step will give the above specified error.

According to me the error is due to error in serializing the values in csdeg and cloud.cscfg files.

amarzavery commented 11 years ago

Did some investigation on the following error:

Validation Errors: Error validating the .cscfg file against the .csdef file. Severity:Error, message:Setting 'AZURE_STORAGE_ACCOUNT' for role 'WorkerRole1' specified in the service configuration file is not declared in the service definition file.,Error validating the .cscfg file against the .csdef file. Severity:Error, message:Setting 'AZURE_STORAGE_ACCESS_KEY' for role 'WorkerRole1' specified in the service configuration file is not declared in the service definition file. The long running operation tracking ID was: 09760d0d30484374bc7c19721795c187.

Mark thought that this could very well be serialization issue. To confirm this I tried unpacking package.cspkg that gets generated after executing the command --> azure service project package blobtestfriday -v

Found some steps to unpack a cspkg file on internet... Pasting those for reference

How to Unpack .cspkg file

  1. Go inside app.publish folder
  2. Rename your .cspkg file to .zip
  3. Unpack that .zip folder
  4. Inside the Uncompressed folder there is a file named after your web role .cssx
  5. Rename the .cssx file to .zip
  6. This .zip file is unencrypted now. Unzip it.
  7. Find the content of your package in the “sitesroot” folder. ( I found approot folder instead….)

As per Andre's guideline, I first converted cloud_package.cspkg file to a new version by doing the following steps

D:\test\blobuploadtest01>cspack /convertToCtpPackage:cloud_package.cspkg;cloud.cspkg

Then I compared ServiceDefinition.csdef files in both the unpacked packages

csdef

and ServiceDefinition.rdef files in both the packages

rdef

This is definitely a serialization issue. Access_key and Account_name xml nodes were missing. Hence, the above error makes sense.