Azure / connectthedots

Connect tiny devices to Microsoft Azure services to build IoT solutions
http://connectthedots.io
MIT License
399 stars 275 forks source link

AzurePrep failing... not a good sign #168

Closed mpilant closed 9 years ago

mpilant commented 9 years ago

OK. I was having problems with Stream Analytics, and alerts so I decided to flush everything I had done and start over.

Well, it didn't go so good. With a fresh download of the repository, and a (Release) build using Visual Studio Ultimate, I got the following. Something appears to be broken with at least the Stream Analytics, and I don't know if the objects (Service Bus, Event Hubs, etc.) created prior to that were created correctly.

I've been working at this since mid-April to get this all working successfully. To date, I have only been able to get data sent to the Event Hub and displayed on the web site. I didn't think it would be so hard :-(


Waiting for authentication result... Retrieving a list of subscriptions... List of available subscriptions: 1: XXXXXX 2: Visual Studio Ultimate with MSDN 3: XXXXXXXX-XXX Please select subscription number: 2 Are you sure you want to use Visual Studio Ultimate with MSDN subscription?(y) y Requesting access to subscription... Enter a name for Service Bus Namespace (only letters and digits, less than 17 chars long). (Note that fully qualified path may also be subject to further length restrictions.) lmpctd4 Are you sure you want to create a namespace called lmpctd4?(y) y Retrieving a list of Locations... Available locations: 1: Central US 2: East US 3: East US 2 4: North Central US 5: South Central US 6: West US 7: North Europe 8: West Europe 9: East Asia 10: Southeast Asia 11: Brazil South 12: Japan East 13: Japan West Please select Location from list: 2 Are you sure you want to select location East US?(y) y Creating Service Bus namespace lmpctd4-ns in location East US Service Bus namespace lmpctd4-ns created. Namespace lmpctd4-ns in state Activating. Waiting... Namespace lmpctd4-ns in state Activating. Waiting... Namespace lmpctd4-ns in state Activating. Waiting... Creating Event Hub ehdevices... Service Bus connection string not valid yet. Waiting... Do you want to create ehalerts Event Hub? (y/n) y Are you sure you want to create ehalerts Event Hub?(y) y Creating Event Hub ehalerts... Creating Storage Account lmpctd4storage in location East US... Do you want to create Stream Analytics jobs? (y/n) y Are you sure you want to create Stream Analytics jobs?(y) y Retrieving a list of Resource Groups... Available Resource Groups: 1: Default-Storage-EastUS Please select Resource Group from list: 1 Are you sure you want to select Resource Group Default-Storage-EastUS?(y) y Do you want to create Aggregates job? (y/n) y Are you sure you want to create Aggregates job?(y) y Creating Aggregates Stream Analytics job... Exception on creation Stream Analytics Job lmpctd4Aggregates: One or more errors occurred. Do you want to create Alert job? (y/n) y Are you sure you want to create Alert job?(y)

Do you want to create Alert job? (y/n) y Are you sure you want to create Alert job?(y) y Creating Alert Stream Analytics job... Exception on creation Stream Analytics Job lmpctd4Alert: One or more errors occurred. Do you want to create cg4pbi job? (y/n) y Are you sure you want to create cg4pbi job?(y) y Creating cg4pbi Stream Analytics job... Exception on creation Stream Analytics Job lmpctd4cg4pbi: One or more errors occurred. Do you want to create LightSensor job? (y/n) y Are you sure you want to create LightSensor job?(y) y Creating LightSensor Stream Analytics job... Exception on creation Stream Analytics Job lmpctd4LightSensor: One or more errors occurred.

Service Bus management connection string (i.e. for use in Service Bus Explorer):

Endpoint=sb://lmpctd4-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=scnBk4srsCi6EFjcTZFnqwHrqJ55F8Kk1Zv43nq1CZ8=

Device AMQP address strings (for Raspberry PI/devices): amqps://D1:3QWj3%2FqWrAPcClL2Vs2lIFquoV1rlawK7sqUkZxXrkI%3D@lmpctd4-ns.servicebus.windows.net amqps://D2:%2BrDmuHuxDFLQGabVI7LkmWEX26%2FBKcJzLsf7GK%2F1F48%3D@lmpctd4-ns.servicebus.windows.net amqps://D3:ziVCujdKgguZl7ykVkdylkoEZcnFT7Y74y%2Bh2T8mHPs%3D@lmpctd4-ns.servicebus.windows.net amqps://D4:yB0tP6WHq%2B1cxStYms9JQwOwpxbURU30WU%2BVdV3Z%2B3Y%3D@lmpctd4-ns.servicebus.windows.net

Output was saved to your desktop, at C:\Users\mpilant\Desktop\lmpctd4-ns_20_May_6_23.log file. Please hit enter to close.

olivierbloch commented 9 years ago

Hi @mpilant I just rerun the AzurePrep and everything worked well for me. I have seen issues with locations in the past (when services were not all in the same location), but it doesn't seem that this is your issue here. Can you try and run the AzurePrep app in debug mode to see if Visual Studio catches exceptions that could help narrow down what the issue is?

ghost commented 9 years ago

Have you tried to create a Stream Analytics job manually from manage.windowsazure.com? Would be interesting to know if/where that fails.

mpilant commented 9 years ago

@oliverbloch: I can give it a try, but won't be for a bit as I have other things on my schedule in front. One thought I had is whether or not the failures might have been related to the management portal problem yesterday evening (UTC).

@spyrossak: I tried doing the SA setup manually using the recently restored instructions, and could not get it to work. There was nothing in the operations log to indicate any sort of a problem. This was my reason for flushing everything and trying over with the latest bits.

ghost commented 9 years ago

Where does it fail when you try to set up SA manually? Go to Manage.windowsazure.com, select Stream Analytics in the left pane, and click the "+ New" icon at the bottom of the page. With Stream Analytics highlighted in the second pane from the left, click "Quick Create" in the third pane. Then enter a job name on the right, pick the same region, subscription, and storage account you created, and select Create Stream Analytics Job. Does that create a job, or fail? If it fails, you have an access problem wrt Stream Analytics, and should call tech support at Microsoft. If it succeeds, follow the instructions in the manual ConnectTheDots instructions, and start the job. If that fails to start, you will have items in the Operations Logs. Find the first failure, and let me know the details.

mpilant commented 9 years ago

@spyrossak: The problem isn't that the SA fails to create, it fails to "operate". IN other words, I can successfully create the SA resource, add an input, output, and query but nothing ever happens. The status for the SA resource is most often shown as "degraded"; but I haven't found out what the really means. The other piece is I believe I'm supposed to see alerts generated and displayed on the website, but I have never seen any.

In all of this, nothing has appeared in the operations logs. So, no clues as to what is going wrong.

ghost commented 9 years ago

After you created input, created and saved query, and created output, did you start the job? The operations logs should show "starting", then other messages.

ghost commented 9 years ago

In the end, it should say "started" or "failed"

mpilant commented 9 years ago

@spyrossak: Yep. Started all three jobs. Nothing in the logs. Very strange.

ghost commented 9 years ago

That is strange. Try this again, step by step for one job. Create "miplartest". When you look at the list of SA jobs, it should show status = "Created". When you create the Input, Query, and Output as above, and then click "Start", the list of jobs should show "Starting". At the bottom right of your screen you should see a little progress icon with numbers, starting at 1 going up maybe to 7 or 8 over the course of the next few minutes. That will end with a "completed" or a "failed". At that point, click on your job to get to the screen where it shows the name at the top, and a menu bar that says "Dashboard Monitor Inputs Query Outputs Scale Configure". Underneath you should see a chart that shows the number of messages received by the Input. Regardless of whether that shows any or not, click on "Operations Logs" under Management Services at the bottom right. That should show a list of operations, starting with "Starting" and either ending with "Failed to start" or a series of operations like "Receive Events" with status equal to Succeeded or Failed, or "Process Events" with status Succeeded or Failed, etc. If you see those, click on the first "Failed" and then click on the "Details" at the bottom of the screen to diagnose the source; if you do not see those, call MS Tech Support as something is going on that needs their attention.

mpilant commented 9 years ago

@spyrossak: I'll give it a try when I back to my system on Monday. I'll post the results here.

mpilant commented 9 years ago

Wasn't able to try the SA steps because I deleted everything from my previous incarnation where everything except SA was working.

I just cleaned everything out (I hope) and tried the AzurePrep again; after doing a rebuild in VS, just in case. This attempt, from about 10 minutes ago, fails exactly in the same was as my original post: exceptions creating the Stream Analytics jobs. The Azure status page shows everything working, so my first attempt was not the result of the management portal outage last week.

Looking at the GitHub repository, there do not appear to have been any changes since I downloaded everything (to try again). I'm going to try my MSDN Ultimate Azure subscription instead of my Visual Studio Online subscription to see if I get any different results. However, I do not have high hopes.

mpilant commented 9 years ago

I just tried using my MSDN Azure subscription, and the SA job creation failed in exactly the same way.

I'm going to go back to the old code and see if I can at least get the website up and running again... and then try to tackle the Stream Analytics failures.

ghost commented 9 years ago

There is little point trying AzurePrep over and over again until you have verified that your account(s) are enrolled for and work with Stream Analytics. Suggest you try the manual steps I posted earlier and check to see where things fail.

mpilant commented 9 years ago

Unless I'm missing something (always a possibility), unless I have an event up to feed SA, I won't get very far. Since I had cleaned everything out, there was nothing left to feed SA. That is why I was trying AzurePrep again. Unfortunately, I just tried the last working version and it is now failing with a exception trying to create the first event hub.

As far as creating SA jobs, I have been able to do that. The problem is after starting, they don't "do" anything and there is nothing in the logs to indicate what is failing. By "do" anything, I mean no alerts were getting posted to the CTD website. The website only showed the data being collected.

ghost commented 9 years ago
  1. You said the operations logs in SA showed nothing, not even "starting", or reason why they were "deprecated". That is why I was suggesting the manual steps, to make sure that this part was working.
  2. you are correct, if SA is not receiving any events, then there would be no "receive" item in the ops logs, and the job would show as idle. If SA is not receiving any events, then either your ehdevices event hub is not receiving any events (would be seen in the dashboard for the event hub) or your SQL statement is not finding anything that meets your select statement.
  3. if there are no "receive" events in the Ops logs, there is no chance that SA will have any "send" events in the Ops logs, and will not send anything to the website to show as anomalies.

Suggest you use "EHConsole" to show what your ehdevices is receiving. Copy a few records of the output into a post here - maybe I can see if something is odd at this stage.

mpilant commented 9 years ago
  1. Yep, not even starting. Although the portal did show them starting/started.

Where is EHConsole? I know I have seen it in my travels, but I can't remember where :-(

BTW, I was just able to create the service bus and hubs with the "older" code. The only difference is the failing attempt I was running AzurePrep.exe from a command window in the \bin\release directory and the succeeding one was using F5 in Visual Studio. The two should be the same, but I have seen stranger things happen. :-P Now to get the rest of it set up, and try SA again.

dinarisio commented 9 years ago

@mpilant Are there any messages contained in exceptions details?

mpilant commented 9 years ago

@dinarisio Just what is shown in the original post.

dinarisio commented 9 years ago

@mpilant I've pushed change to see if it will allow to get more details about exception. Could you please try to create SA jobs again using current version and send new exception details it there would be any?

mpilant commented 9 years ago

@dinarisio Here is the output: Waiting for authentication result... Retrieving a list of subscriptions... List of available subscriptions: 1: xxxxxx 2: Visual Studio Ultimate with MSDN 3: xxxxxxxxxxx Please select subscription number: 2 Are you sure you want to use Visual Studio Ultimate with MSDN subscription?(y) y Requesting access to subscription... Enter a name for Service Bus Namespace (only letters and digits, less than 17 chars long). (Note that fully qualified path may also be subject to further length restrictions.) lmpctd7 Are you sure you want to create a namespace called lmpctd7?(y) y Retrieving a list of Locations... Available locations: 1: Central US 2: East US 3: East US 2 4: North Central US 5: South Central US 6: West US 7: North Europe 8: West Europe 9: East Asia 10: Southeast Asia 11: Brazil South 12: Japan East 13: Japan West Please select Location from list: 2 Are you sure you want to select location East US?(y) y Creating Service Bus namespace lmpctd7-ns in location East US Service Bus namespace lmpctd7-ns created. Namespace lmpctd7-ns in state Activating. Waiting... Namespace lmpctd7-ns in state Activating. Waiting... Namespace lmpctd7-ns in state Activating. Waiting... Namespace lmpctd7-ns in state Activating. Waiting... Creating Event Hub ehdevices... Service Bus connection string not valid yet. Waiting... Service Bus connection string not valid yet. Waiting... Do you want to create ehalerts Event Hub? (y/n) y Are you sure you want to create ehalerts Event Hub?(y) y Creating Event Hub ehalerts... Creating Storage Account lmpctd7storage in location East US... Do you want to create Stream Analytics jobs? (y/n) y Are you sure you want to create Stream Analytics jobs?(y) y Retrieving a list of Resource Groups... Available Resource Groups: 1: Default-Storage-EastUS Please select Resource Group from list: 1 Are you sure you want to select Resource Group Default-Storage-EastUS?(y) y Do you want to create Aggregates job? (y/n) y Are you sure you want to create Aggregates job?(y) y Creating Aggregates Stream Analytics job... Exception on creation Stream Analytics Job lmpctd7Aggregates: One or more errors occurred. Inner exception message: NoRegisteredProviderFound: No registered resource provider found for location 'East US' and API version '2015-03-01-preview' for type 'streamingjobs'. The supported api-versions are '2015-03-01-preview, 2015-04-01, 2015-05-01, 2014-04-01'. The supported locations are 'centralus, westeurope, eastus2, northeurope, japaneast, westus, southeastasia, southcentralus, eastasia, japanwest, northcentralus, '. Do you want to create Alert job? (y/n) y Are you sure you want to create Alert job?(y) y Creating Alert Stream Analytics job... Exception on creation Stream Analytics Job lmpctd7Alert: One or more errors occurred. Inner exception message: NoRegisteredProviderFound: No registered resource provider found for location 'East US' and API version '2015-03-01-preview' for type 'streamingjobs'. The supported api-versions are '2015-03-01-preview, 2015-04-01, 2015-05-01, 2014-04-01'. The supported locations are 'centralus, westeurope, eastus2, northeurope, japaneast, westus, southeastasia, southcentralus, eastasia, japanwest, northcentralus, '. Do you want to create cg4pbi job? (y/n) y Are you sure you want to create cg4pbi job?(y) y Creating cg4pbi Stream Analytics job... Exception on creation Stream Analytics Job lmpctd7cg4pbi: One or more errors occurred. Inner exception message: NoRegisteredProviderFound: No registered resource provider found for location 'East US' and API version '2015-03-01-preview' for type 'streamingjobs'. The supported api-versions are '2015-03-01-preview, 2015-04-01, 2015-05-01, 2014-04-01'. The supported locations are 'centralus, westeurope, eastus2, northeurope, japaneast, westus, southeastasia, southcentralus, eastasia, japanwest, northcentralus, '. Do you want to create LightSensor job? (y/n) y Are you sure you want to create LightSensor job?(y) y Creating LightSensor Stream Analytics job... Exception on creation Stream Analytics Job lmpctd7LightSensor: One or more errors occurred. Inner exception message: NoRegisteredProviderFound: No registered resource provider found for location 'East US' and API version '2015-03-01-preview' for type 'streamingjobs'. The supported api-versions are '2015-03-01-preview, 2015-04-01, 2015-05-01, 2014-04-01'. The supported locations are 'centralus, westeurope, eastus2, northeurope, japaneast, westus, southeastasia, southcentralus, eastasia, japanwest, northcentralus, '.

Service Bus management connection string (i.e. for use in Service Bus Explorer): Endpoint=sb://lmpctd7-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Device AMQP address strings (for Raspberry PI/devices): amqps://D1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd7-ns.servicebus.windows.net amqps://D2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd7-ns.servicebus.windows.net amqps://D3:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd7-ns.servicebus.windows.net amqps://D4:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd7-ns.servicebus.windows.net

Output was saved to your desktop, at C:\Users\mpilant\Desktop\lmpctd7-ns_27_May_2_14.log file. Please hit enter to close.

dinarisio commented 9 years ago

As far as I see here, API suggests to use East US 2 instead East US for some reason. I've added ability to create new resource group from AzurePrep (please sync with master). Would you mind trying to use East US 2 when AzurePrep asks for Location and create new Resource Group for that (select 0 when AzurePrep will ask for a RG number)?

mpilant commented 9 years ago

Q: I'm assuming "0" means to create a new RG?

mpilant commented 9 years ago

Also, it is curious the "older" code worked correctly creating in "East US".

dinarisio commented 9 years ago

@mpilant yes, you will see. Strange enough, but need to locate if this is the issue.

mpilant commented 9 years ago

@dinarisio OK, using "East US 2" allowed everything to be created successfully:

Waiting for authentication result... Retrieving a list of subscriptions... List of available subscriptions: 1: xxxxx 2: Visual Studio Ultimate with MSDN 3: xxxxxxxxxxxx Please select subscription number: 2 Are you sure you want to use Visual Studio Ultimate with MSDN subscription?(y) y Requesting access to subscription... Enter a name for Service Bus Namespace (only letters and digits, less than 17 chars long). (Note that fully qualified path may also be subject to further length restrictions.) lmpctd9 Are you sure you want to create a namespace called lmpctd9?(y) y Retrieving a list of Locations... Available locations: 1: Central US 2: East US 3: East US 2 4: North Central US 5: South Central US 6: West US 7: North Europe 8: West Europe 9: East Asia 10: Southeast Asia 11: Brazil South 12: Japan East 13: Japan West Please select Location from list: 3 Are you sure you want to select location East US 2?(y) y Creating Service Bus namespace lmpctd9-ns in location East US 2 Service Bus namespace lmpctd9-ns created. Namespace lmpctd9-ns in state Activating. Waiting... Namespace lmpctd9-ns in state Activating. Waiting... Namespace lmpctd9-ns in state Activating. Waiting... Creating Event Hub ehdevices... Service Bus connection string not valid yet. Waiting... Service Bus connection string not valid yet. Waiting... Do you want to create ehalerts Event Hub? (y/n) y Are you sure you want to create ehalerts Event Hub?(y) y Creating Event Hub ehalerts... Creating Storage Account lmpctd9storage in location East US 2... Do you want to create Stream Analytics jobs? (y/n) y Are you sure you want to create Stream Analytics jobs?(y) y Retrieving a list of Resource Groups... Available Resource Groups: 0: Create new Resource Group. 1: Default-Storage-EastUS2 Please select Resource Group from list: 0 Are you sure you want to create new Resource Group?(y) y Enter a name for Resource Group (only letters and digits, less than 17 chars long). (Note that fully qualified path may also be subject to further length restrictions.) lmpctdrg9 Are you sure you want to create a Resource Group called lmpctdrg9?(y) y Do you want to create Aggregates job? (y/n) y Are you sure you want to create Aggregates job?(y) y Creating Aggregates Stream Analytics job... Stream Analytics job lmpctd9Aggregates created. Do you want to create Alert job? (y/n) y Are you sure you want to create Alert job?(y) y Creating Alert Stream Analytics job... Stream Analytics job lmpctd9Alert created. Do you want to create cg4pbi job? (y/n) y Are you sure you want to create cg4pbi job?(y) y Creating cg4pbi Stream Analytics job... Stream Analytics job lmpctd9cg4pbi created. Do you want to create LightSensor job? (y/n) y Are you sure you want to create LightSensor job?(y) y Creating LightSensor Stream Analytics job... Stream Analytics job lmpctd9LightSensor created.

Service Bus management connection string (i.e. for use in Service Bus Explorer): Endpoint=sb://lmpctd9-ns.servicebus.windows.net/;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Device AMQP address strings (for Raspberry PI/devices): amqps://D1:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd9-ns.servicebus.windows.net amqps://D2:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd9-ns.servicebus.windows.net amqps://D3:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd9-ns.servicebus.windows.net amqps://D4:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx@lmpctd9-ns.servicebus.windows.net

Output was saved to your desktop, at C:\Users\mpilant\Desktop\lmpctd9-ns_27_May_3_37.log file. Please hit enter to close.

mpilant commented 9 years ago

Well, slightly better. With the most recent code, I am at the point I was where I was trying to get Stream Analytics to work. Since that is really unrelated to this topic, I'll start another one; since my original one was closed.