Azure-Functions icon indicating copy to clipboard operation
Azure-Functions copied to clipboard

Internal Server Error - https://<app_name>.azurewebsites.net/admin/host/keys

Open btardif opened this issue 8 years ago • 93 comments

From @handeeadiguzel on February 12, 2018 15:1

Please provide us with the following information:

OS and Browser

Windows & Chrome

Repro steps

  1. Create function app from azure portal
  2. Change runtime version to beta (2.0.11415.0 (beta))
  3. Enable deployment slots

Host keys are gone (portal doesn't show them anymore). And cannot add new keys.

Any error messages

Internal Server Error - https://<app_name>/admin/host/keys Session Id: 40a3ea0af19f42ceae950c973d66b770

Timestamp: 2018-02-12T14:42:19.631Z

Mention any other details that might be useful.

Copied from original issue: Azure/azure-functions-ux#2334

btardif avatar Mar 15 '18 23:03 btardif

@ahmelsayed can you take a look?

btardif avatar Mar 15 '18 23:03 btardif

Hello I'm struggling the same issue. But runtime version is 1. It just stopped working. Any updates on it?

Neonkiller avatar May 24 '18 08:05 Neonkiller

I'd like to get some more info on this as well. We are getting this after creating a Azure Function via Terraform & deploying via Octopus Deploy.

This was working perfectly fine a week ago, now it's just failing continually

APErebus avatar Jun 26 '18 03:06 APErebus

I'm now getting this as well on a function after deploying a new release. :'(

no keys image

Error:

Internal Server Error - https://<name>.azurewebsites.net/admin/host/keys
Session Id: e2207e819afe493687b65cf4b1441f71

Timestamp: 2018-06-26T13:21:21.196Z
Error:

Internal Server Error - https://<name>.azurewebsites.net/admin/host/systemkeys/_master
Session Id: e2207e819afe493687b65cf4b1441f71

Timestamp: 2018-06-26T13:23:12.606Z

I do have a host.json in the file system. Its full of encrypted keys.

> ls
D:\home\data\Functions\secrets
host.json

worldspawn avatar Jun 26 '18 13:06 worldspawn

@paulbatum can you triage this item?

btardif avatar Jun 26 '18 22:06 btardif

@btardif We have identified a possible cause for this. We were creating our function app using the terraform azure provider which seems to also create a few basic settings. Two of those settings are: WEBSITE_CONTENTSHARE WEBSITE_CONTENTAZUREFILECONNECTIONSTRING

These settings arn't part of our deployment so they are being removed when we deploy. The act of removing them seems to break the function app. I'm told these settings are intended for consumption plan backed functions only.

We couldn't hack terraform into not doing that so we've just added them to our set of dev settings until the provider can be patched.

worldspawn avatar Jun 27 '18 06:06 worldspawn

Any final resolution on this issue? I'm running into this when deploying a fresh Function App with a FUNCTIONS_EXTENSION_VERSION: beta AppSetting.

Gowiem avatar Jul 06 '18 13:07 Gowiem

@ahmelsayed @paulbatum can you guys comment on this?

btardif avatar Jul 06 '18 18:07 btardif

I'm also getting '500 Internal Server Error' when deploying a new, v2 C# Function App. I've even tried doing a simple Hello World app and still get the same behaviour.

Any updates on this?

Davy-F avatar Aug 29 '18 08:08 Davy-F

I had the same problem. It was caused because I applied additional App Settings configurations in a second step using PowerShell where I accidentally wiped out default App Settings. After that, redeployment of the Function App failed and the only fix was to delete and recreate the Function App.

SteveVoros avatar Aug 29 '18 20:08 SteveVoros

@btardif Continuing to run into this issue with a function app deployed with FUNCTIONS_EXTENSION_VERSION: 2.0.11961-alpha.

Gowiem avatar Aug 31 '18 11:08 Gowiem

For anyone running into this issue with a beta runtime version -- An important note that I have not found elsewhere - If you're adding an Application Insights Extension to your function which runs a 2.x Runtime then it will fail with this error. The fix is to include the AI App Setting key manually, remove the AI Extension from the Function App, and then restart. Then it will work.

Gowiem avatar Aug 31 '18 14:08 Gowiem

It seems, host keys aren't working in this build. I vote for that this is a bug.

kazinad avatar Sep 03 '18 17:09 kazinad

I'm facing the same issue after being delpoyed new function app to azure with java runtime

Error:

Internal Server Error - https://scanandgo-warmup.azurewebsites.net/admin/host/keys Session Id: ae893841c0764d98bc44b939653295c5

Timestamp: 2018-09-09T03:03:00.461Z

pragathikadaganchi avatar Sep 09 '18 03:09 pragathikadaganchi

Facing the same issue.

Steps to repro:

  1. Create new Functions App on Windows with App Service Plan.
  2. Change runtime to V2
  3. Create a new JS HTTP trigger function.

Expected result: Things are OK.

Actual Result: Host Keys are deleted and can't be created.

Error:

Internal Server Error - https://locafi-ingress-2.azurewebsites.net/admin/host/systemkeys/_master

Session Id: 9cb3c262b262401096ad8aaebf637e03

Timestamp: 2018-09-12T05:02:45.815Z

xtellurian avatar Sep 12 '18 06:09 xtellurian

I am not able to reproduce, in general. I investigated a few cases where the function app name and timestamp were shared.

@xtellurian Your function app is hitting outbound connection exhaustion errors. It looks like the connections are being exhausted by other applications running on your same app service plan. I am not able to tell which application is doing it, but I can see there are a huge amount of connections (~1900) to a specific IP address and port. If you need additional details and you're OK with me sharing the full IP and port, let me know and I can do so.

@pragathikadaganchi I'm seeing a similar case to the one above - errors relating to outbound connection exhaustion. In your case I see ~500 connections to a specific IP and port. Again, if you're OK with me sharing full details, let me know and I will do so.

I have filed https://github.com/Azure/azure-functions-host/issues/3444 to track some improvements that can be made.

Also, it looks like there are additional logs that are missing in version 12050 that would be helpful in narrowing down further why exactly these connection issues are impacting the master key API. We have fixed the issue that is preventing these logs from being present. So once the new version of functions is deployed, we can take another look at the logs for apps that are still hitting this error, and they should help further troubleshooting.

paulbatum avatar Sep 13 '18 00:09 paulbatum

@paulbatum Ah, OK that's a bug, I believe it's from not re-using the connection to IoT Hub (the function is acting as a proxy for HTTP messages into IoT Hub).

I'll try to repro in a new App Service

xtellurian avatar Sep 17 '18 00:09 xtellurian

Any update on this? I just ran into the same error today.

chris-rogala avatar Oct 31 '18 17:10 chris-rogala

This investigation has stalled. Cases I looked at were due to other problems (see my recent reply above). If you post detailed information about your particular case we can take a look at our logs.

paulbatum avatar Nov 01 '18 01:11 paulbatum

I'm running into this with a new Azure function app.

Internal Server Error - https://api-inscape.azurewebsites.net/admin/host/keys Session Id: 36e8a8ca2d4146eebabe5dc3aaad58d7

Timestamp: 2018-11-09T15:38:25.898Z

scottalankrieger avatar Nov 09 '18 15:11 scottalankrieger