Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with manage.iis.net's interface #25

Closed
StephenShamakian opened this issue Oct 13, 2016 · 25 comments · Fixed by #29
Closed

Bug with manage.iis.net's interface #25

StephenShamakian opened this issue Oct 13, 2016 · 25 comments · Fixed by #29
Assignees

Comments

@StephenShamakian
Copy link

StephenShamakian commented Oct 13, 2016

When testing out the https://manage.iis.net interface it is only showing one website when the server and the API report multiple.

API Output:
issue1

Interface Output:
issue2

@jimmyca15
Copy link
Member

@RedTechie

What browser was this running in? Is there an error being displayed in the developer console (F12)?

@jimmyca15 jimmyca15 added the bug label Oct 13, 2016
@jimmyca15 jimmyca15 self-assigned this Oct 13, 2016
@simplespirit
Copy link

I also only see the default site in both IE11 and Chrome. In the Console for Chrome I get:

Uncaught SyntaxError: Unexpected end of JSON input(anonymous function) @ content.js:7

@jimmyca15
Copy link
Member

jimmyca15 commented Oct 13, 2016

image

Can you try clearing the cache and reloading? The easiest way is to check the "Disable cache" box as shown in the picture.

@simplespirit
Copy link

Done. Same error in Chrome. FWIW I get no console errors in IE but still only see the default site. When I go to App Pools I see the entire list.

[cid:[email protected]]
From: Jimmy Campbell [mailto:[email protected]]
Sent: Thursday, October 13, 2016 3:53 PM
To: Microsoft/IIS.Administration [email protected]
Cc: Chris Wallace (IT) [email protected]; Comment [email protected]
Subject: Re: [Microsoft/IIS.Administration] Bug with manage.iis.net's interface (#25)

[image]https://cloud.githubusercontent.com/assets/21000428/19364619/bec6124c-9143-11e6-8da3-8fd7575bd5d8.png

Can you try clearing the cache and reloading? The easiest way is to check the "Disable cache" box as shown in the picture.


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/25#issuecomment-253620422, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVxD21jSz6vk-Txelp0z7ZxnkOctabQeks5qzowjgaJpZM4KV3TZ.

@StephenShamakian
Copy link
Author

I'm not by my workstation ATM. But I was using Firefox when I experienced the issue. I used firebug to dig deeper and I did not see any errors in the console.

I also noticed that the jason results returned from the API in firebug was only returning one website. So it may be a bug with the API... But in the API explorer it was returning fine.

@simplespirit
Copy link

I also only see one response in the JSON using fiddler.

From: RedTechie [mailto:[email protected]]
Sent: Thursday, October 13, 2016 4:03 PM
To: Microsoft/IIS.Administration [email protected]
Cc: Chris Wallace (IT) [email protected]; Comment [email protected]
Subject: Re: [Microsoft/IIS.Administration] Bug with manage.iis.net's interface (#25)

I'm not by my workstation ATM. But I was using Firefox when I experienced the issue. I used firebug to dig deeper and I did not see any errors in the console.

I also noticed that the jason results returned from the API in firebug was only returning one website. So it may be a bug with the API... But in the API explorer it was returning fine.


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/25#issuecomment-253622986, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVxD21oCa2cO_9-QSFsmz7kr1BKC1eK3ks5qzo6EgaJpZM4KV3TZ.

@jimmyca15
Copy link
Member

jimmyca15 commented Oct 13, 2016

The fact that the websites are showing up in the API Explorer means the API is returning the correct response. The explorer is making ajax requests to the API just like manage.iis.net. Somehow the ajax request from manage.iis.net is getting cut short.

@jimmyca15
Copy link
Member

Similar behavior has happened before that was being caused by an exception happening during the serialization of the response. If this is the case then the exception should appear in the API's logs. If you look in
C:\Program Files\IIS Administration\1.0.36\Microsoft.IIS.Administration\logs
If there has been any exceptions there should be a log file with a name similar to log-20161004.txt. Would you mind attaching that if it exists?

@StephenShamakian
Copy link
Author

Yup there are some stack traces!

2016-10-13 18:15:02.814 -04:00 [Error] Connection id ""0HKVHSNFKM4SU"": An unhandled exception was thrown by the application.
System.NullReferenceException: Object reference not set to an instance of an object.
at Microsoft.IIS.Administration.WebServer.Sites.SiteHelper.ToJsonModel(Binding binding)
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter.WriteObject(TextWriter writer, Object value)
at Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter.d__9.MoveNext()

2016-10-13 18:15:02.876 -04:00 [Error] Object reference not set to an instance of an object.
at Microsoft.IIS.Administration.WebServer.Sites.SiteHelper.ToJsonModel(Binding binding)
at System.Linq.Enumerable.SelectEnumerableIterator`2.MoveNext()
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeList(JsonWriter writer, IEnumerable values, JsonArrayContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty)
at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType)
at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType)
at Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter.WriteObject(TextWriter writer, Object value)
at Microsoft.AspNetCore.Mvc.Formatters.JsonOutputFormatter.d__9.MoveNext()

@jimmyca15
Copy link
Member

jimmyca15 commented Oct 13, 2016

Awesome, thank you so much for that. The stack trace tells us that there is a problem retrieving the bindings for the website. I'm going to try to repro this now.

@jimmyca15
Copy link
Member

What is the bindings setup for your second website?

@jimmyca15
Copy link
Member

jimmyca15 commented Oct 13, 2016

I was able to reproduce this issue. If you create an https binding for a website that does not have a valid certificate mapped to the chosen port then this error will occur. If a site is created through the API there shouldn't be a way to get into this state.

Did you create these sites through the API/manage.iis.net or some other method?

Solution
Change the binding from HTTPS to HTTP. Then through the API, manage.iis.net, or INetMgr change the binding to HTTPS whilst providing a certificate to use.

Until we fix the API to handle this state, the change will have to be done through INetMgr or https can be removed manually then added back with the API.

Manually removing https
In the applicationHost.config file, find the site element that is experiencing the issue. Find the https binding and change protocol="https" to protocol="http", for example.

to

@StephenShamakian
Copy link
Author

StephenShamakian commented Oct 13, 2016

Looking into this. But at first glance all of the certs are valid when viewed through Inetmgr. The bindings were created using Inetmgr. I have not tired creating any sites or objects using the API as of yet.

One thing that does seem to be consistent is it's only affecting the sites with SSL bindings.

EDIT: Actually scratch that... I just deleted the https binding from one of the sites (leaving only http) and its still not showing up with the same two stack traces.

I know documentation is coming soon but what is this API command doing: https://SERVERIP:55539/api/webserver/websites?fields=name,status,physical_path,bindings,application_pool

I'm assuming it's doing some sort of filtering? When I remove bindings from the request it outputs all the data fine. I also noticed that no "application_pool" data is being included in that request. Shouldn't it be?

@jimmyca15
Copy link
Member

https://SERVERIP:55539/api/webserver/websites?fields=name,status,physical_path,bindings,application_pool queries all sites from the API and requests that the listed fields of the sites be displayed. The application_pool data isn't going to be displayed if this bug is occurring because the bug is terminating the JSON response.

@jimmyca15
Copy link
Member

Also are the certificates on a Central Cert Store?

@StephenShamakian
Copy link
Author

Ah That would make sense! As it falls in line with what I just found out! I had to remove the below non-http/https bindings from the one site that was working:
issue3

After removing those all the rest of the sites appeared! I don't know why but we see those bindings appear randomly on our servers. Any idea why or what causes them?

@jimmyca15
Copy link
Member

jimmyca15 commented Oct 14, 2016

Thank you again. There was actually multiple issues at play here. I found one and you have found another. Those bindings appear on the default web site if you have certain optional windows features enabled. For example, the picture below causes the net.tcp binding. Unfortunately we did not take into account other activation mechanisms and if those bindings are present then this error will occur. We will fix this for our next release.

image

@StephenShamakian
Copy link
Author

No problem! Glad to help out! Been waiting anxiously for the API :D Super excited it's in preview!

So I don't seem to have those options (This is on a 2008 R2 server):
issue4

@jimmyca15
Copy link
Member

In your case "non http activation" should be the cause of net.tcp bindings appearing. They are there even when it is off?

@StephenShamakian
Copy link
Author

Yup, we randomly see them appear on some servers occasionally. We thought it was something to do with .NET re-registering itself or something but weren't exactly sure why we would randomly see them appear.

@simplespirit
Copy link

I suspect my experience is the same issue. I built an app to allow our devs to proxy app pool cycling and noticed those weird mappings on one of the sites. I'm using the web.admin class and not json so it wasn't an issue and I just filtered out the odd bindings.

Get Outlook for iOShttps://aka.ms/o0ukef

On Thu, Oct 13, 2016 at 9:35 PM -0400, "RedTechie" <[email protected]mailto:[email protected]> wrote:

Yup, we randomly see them appear on some servers occasionally. We thought it was something to do with .NET re-registering itself or something but weren't exactly sure why we would randomly see them appear.

You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/25#issuecomment-253686843, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVxD2--buinXhfjxo3JI5QpTz-DtAmfJks5qztxTgaJpZM4KV3TZ.

@simplespirit
Copy link

Removed the odd bindings from my default site and now every other site appears as expected. Thanks!

From: RedTechie [mailto:[email protected]]
Sent: Thursday, October 13, 2016 9:35 PM
To: Microsoft/IIS.Administration [email protected]
Cc: Chris Wallace (IT) [email protected]; Comment [email protected]
Subject: Re: [Microsoft/IIS.Administration] Bug with manage.iis.net's interface (#25)

Yup, we randomly see them appear on some servers occasionally. We thought it was something to do with .NET re-registering itself or something but weren't exactly sure why we would randomly see them appear.


You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com//issues/25#issuecomment-253686843, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AVxD2--buinXhfjxo3JI5QpTz-DtAmfJks5qztxTgaJpZM4KV3TZ.

@shirhatti
Copy link
Contributor

Linking related issues to follow their status:

@jimmyca15
Copy link
Member

Re opening this issue until we release the updated API.

@jimmyca15 jimmyca15 reopened this Oct 19, 2016
@jimmyca15
Copy link
Member

Release is live, available at https://manage.iis.net/get. The GUI has been updated as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants