MitchellGulledge / Meraki-vWAN

5 stars 4 forks source link

Subnet Error #36

Closed Michaetfp closed 3 years ago

Michaetfp commented 3 years ago

Good Morning,

Meraki support have asked me to post in this forum, to get the best possible support.

When I have deployed the function app, from the docs, I receive the following errors, can someone provide detail on where I am going wrong?

2021-07-22 08:30:24.566 Result: Failure Exception: KeyError: 'subnets' Stack: File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 398, in _handleinvocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 602, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(args) File "/home/site/wwwroot/Meraki-VWAN-Automation/init__.py", line 876, in main privsub = ([x['localSubnet'] for x in va['subnets'] if x['useVpn'] is True]) Error 2021-07-22 08:30:24.566 Executed 'Functions.Meraki-VWAN-Automation' (Failed, Id=319e7bb3-9ddd-4b7b-af0f-165886af087e, Duration=24558ms) Error 2021-07-22 08:30:24.579 Result: Failure Exception: KeyError: 'subnets' Stack: File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 398, in _handleinvocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 602, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(args) File "/home/site/wwwroot/Meraki-VWAN-Automation/init__.py", line 876, in main privsub = ([x['localSubnet'] for x in va['subnets'] if x['useVpn'] is True])

MitchellGulledge commented 3 years ago

On the site that you have tagged to connect to Meraki vWAN, do you have any subnets selected as Yes for VPN?

Michaetfp commented 3 years ago

Good Morning Mitchell,

On which part of the documentation https://documentation.meraki.com/MX/Deployment_Guides/Cisco_Meraki_MX_Branch_to_Azure_Virtual_WAN_Deployment_Guide

I have follow the steps given by the guide above, However, the Site to site VPN is set to off on the test network, as the expectation was that the function app did the configuration.

We have other sites with Site to Sites Configured, all live sites. Manual setups no SDWAN

Michaetfp commented 3 years ago

Good Morning again,

I have done this again, and get further, but the appliance does not connect, this time I can see it creating a Site in VWAN hub, but its falling to connect, I have checked logs for the correct PSK, I can see that is correct.

Error now is Result: Failure Exception: IndexError: list index out of range Stack: File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 398, in _handleinvocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, self.kwargs) File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/dispatcher.py", line 602, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.8/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(args) File "/home/site/wwwroot/Meraki-VWAN-Automation/init.py", line 991, in main meraki_vpn_failover() File "/home/site/wwwroot/Meraki-VWAN-Automation/init__.py", line 123, in meraki_vpn_failover event_data = events_response_data[-1]['eventData']

Michaetfp commented 3 years ago

Me Again,

I have used your other issues, to set this working as expected, it appears running a Ping from the appliance resolved the above error. Maybe a change to the script to ping the gateway or something to open the tunnel after provisioning, might be beneficial .

MitchellGulledge commented 3 years ago

Apologies for the delay as I have been OOO. But here are the two things that appear to have happened. 1) You still have to manually enable and select what subnets are in or out of VPN. The function app does not do this unfortunately. This is because we annot default to having all vlans go inside the VPN so we ask the customer to chose. But this should be better highlighted in our documentation so apologies. And for the second issue, you are absolutely right and this is due because we will not initiate the tunnel unless there is interesting traffic (pings etc going down tunnel) so it will always appear down as it has not tried to initiate the tunnel. I am going to close this and we can work off the other ticket to enhance the script. I am glad it is working for you now and again apologies for the delay.