Get error message on Login

Sonarr version (exact version): Cant access to Tell
Mono version (if Sonarr is not running on Windows): N/A
OS: Windows Server 2012
Debug logs:
(Make sure debug logging is enabled in settings and post the full log to hastebin/pastebin/dropbox/google drive or something similar, do not post them directly here)
Description of issue:
When accessing Sonarr, I get the login screen, I capture my details and click Login, and get the below error:
The error says I didn’t capture any value in the username field but I did.

{
“message”: “The string can’t be left empty, null or consist of only whitespaces.\r\nParameter name: resource.Username”,
“description”: “System.ArgumentException: The string can’t be left empty, null or consist of only whitespaces.\r\nParameter name: resource.Username\r\n at NzbDrone.Common.EnsureThat.EnsureStringExtensions.IsNotNullOrWhiteSpace(Param1 param) in M:\\BuildAgent\\work\\6c3239faf2b92630\\src\\NzbDrone.Common\\EnsureThat\\EnsureStringExtensions.cs:line 16\r\n at NzbDrone.Api.Authentication.AuthenticationModule.Login(LoginResource resource) in M:\\BuildAgent\\work\\6c3239faf2b92630\\src\\NzbDrone.Api\\Authentication\\AuthenticationModule.cs:line 27\r\n at NzbDrone.Api.Authentication.AuthenticationModule.<.ctor>b__2_0(Object x) in M:\\BuildAgent\\work\\6c3239faf2b92630\\src\\NzbDrone.Api\\Authentication\\AuthenticationModule.cs:line 21\r\n at CallSite.Target(Closure , CallSite , Func2 , Object )\r\n at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)”
}

The error is complaining that the username is empty.

Are you typing in the password or using a password manager to fill it in?
Which browser are you using?

Yes it is, but I am capturing my username and password. I do have a password manager but i have cleared the details for sonar and manually input everything and still got the error message. This has been tested across Safari, Chrome, and Firefox.

You get the exact same error for all of those?
Is Sonarr behind a reverse proxy or are you accessing it directly?

yup, get the same error on all browsers. I also checked on a Galaxy Tab and iPad this evening and got the same issue there too.

I have a dynamic dns service that points to my external dynamic IP, and the router firewall handles the requests with basic port forwarding, to the host server on my network, but this is only when I am accessing externally. Locally on my network I just use the server IP which is static.

This is a recent issue since I could access it externally on Friday last week, and on Sunday I was on sonarr via my local network.

Can you check the version you have installed?

You can do so by checking the properties of NzbDrone.exe in C:\ProgramData\NzbDrone\bin, on the Details tab.

Which .net versions are installed?
The output the first PowerShell command here, would be great: http://stackoverflow.com/a/3495491/8829713

I checked and don’t see any recent changes to the authentication, not quite sure how it’s blowing up like it is.

You could also try switching to Basic authentication by disabling the authentication then setting it again:

Sonarr Version: 2.0.0.4326

PSChildName                   Version                       Release                       Product
-----------                   -------                       -------                       -------
v2.0.50727                    2.0.50727.4927
v3.0                          3.0.30729.4926
Windows Communication Foun... 3.0.4506.4926
Windows Presentation Found... 3.0.6920.4902
v3.5                          3.5.30729.4926
Client                        4.5.51641                     378675                        4.5.1
Full                          4.5.51641                     378675                        4.5.1
Client                        4.0.0.0

Would you be able to post the request and response from Chrome’s Dev Console?

  1. Open Sonarr’s login page
  2. Open of the dev tools (F12)
  3. Go to the Network Tab
  4. Enter username into the Username field and password into the Password field (fake credentials as they will be visible in the clear)
  5. Click login
  6. Copy and the content of the POST request to /login (likely the first request)
  7. Post the information here

Here is the request using myUsername as the username and myPassword as the password:

Request URL:http://xxxxxx.ddns.net/login?returnUrl=/
Request Method:POST
Status Code:500 Internal Server Error
Remote Address:196.209.218.85:80
Response Headers
view source
Cache-Control:no-cache, no-store, must-revalidate
Content-Type:application/json; charset=utf-8
Date:Thu, 22 Sep 2016 05:45:57 GMT
Expires:0
Pragma:no-cache
Server:Microsoft-HTTPAPI/2.0
Transfer-Encoding:chunked
X-ApplicationVersion:2.0.0.4326
Request Headers
view source
Accept:verbose;
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:39
Content-Type:verbose;
Cookie:snatched_view=list; soon_view=thumb; suggest_view=thumb; late_view=list; blu_ray_com_new_releases_view=thumb; imdb_box_office_view=thumb; imdb_top_dvd_rentals_view=thumb; _pk_id.1.64a7=4b4110a1edcc8517.1470977735.9.1473694689.1473694520.; plushContainerWidth=100%25; plushMultiOps=1; plushNoTopMenu=0; _ga=GA1.3.2105562344.1474486596
Host:xxxx.ddns.net
Origin:http://xxxx.ddns.net
Referer:http://xxxxx.ddns.net/login?returnUrl=/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Query String Parameters
view source
view URL encoded
returnUrl:/
Request Payload
username=MyUsername&password=MyPassword
Name
login?returnUrl=/
favicon.ico
login?returnUrl=/favicon.ico
3 requests ❘ 2.9 KB transferred ❘ Finish: 317 ms ❘ DOMContentLoaded: 151 ms ❘ Load: 151 ms

The Response:

{
“message”: “The string can’t be left empty, null or consist of only whitespaces.\r\nParameter name: resource.Username”,
“description”: “System.ArgumentException: The string can’t be left empty, null or consist of only whitespaces.\r\nParameter name: resource.Username\r\n at NzbDrone.Common.EnsureThat.EnsureStringExtensions.IsNotNullOrWhiteSpace(Param1 param) in M:\\BuildAgent\\work\\6c3239faf2b92630\\src\\NzbDrone.Common\\EnsureThat\\EnsureStringExtensions.cs:line 16\r\n at NzbDrone.Api.Authentication.AuthenticationModule.Login(LoginResource resource) in M:\\BuildAgent\\work\\6c3239faf2b92630\\src\\NzbDrone.Api\\Authentication\\AuthenticationModule.cs:line 27\r\n at NzbDrone.Api.Authentication.AuthenticationModule.<.ctor>b__2_0(Object x) in M:\\BuildAgent\\work\\6c3239faf2b92630\\src\\NzbDrone.Api\\Authentication\\AuthenticationModule.cs:line 21\r\n at CallSite.Target(Closure , CallSite , Func2 , Object )\r\n at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)”
}

That should be application/x-www-form-urlencoded

@markus101 got any clues? google is letting me down.

@mrThirsty You don’t happen to have some browser extension installed, do you?

Would you be able to PM me the address you’re using to connect (externally) to Sonarr? I wan to see why the UI is sending data in the wrong format to Sonarr and I haven’t been able to reproduce this locally. I don’t need credentials to actually login, just to hit Sonarr and attempt to login.

Free PEN-test :slight_smile:

Seeing a different behaviour when I test it from here:

Request URL:http://url/login?returnUrl=/
Request Method:POST
Status Code:303 See Other
Remote Address:url:80

Response Headers
Access-Control-Allow-Methods:GET, OPTIONS, PATCH, POST, PUT, DELETE
Access-Control-Allow-Origin:*
Cache-Control:no-cache, no-store, must-revalidate
Content-Encoding:gzip
Content-Length:0
Content-Type:text/html
Date:Fri, 23 Sep 2016 06:45:47 GMT
Expires:0
Location:/login?returnUrl=/
Pragma:no-cache
Server:Microsoft-HTTPAPI/2.0
X-ApplicationVersion:2.0.0.4326

Request Headers
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.8,en-CA;q=0.6,en-GB;q=0.4
Cache-Control:no-cache
Connection:keep-alive
Content-Length:41
Content-Type:application/x-www-form-urlencoded
Host:url
Origin:http://url
Pragma:no-cache
Referer:http://url/login?returnUrl=/
Upgrade-Insecure-Requests:1
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Query String Parameters
view source
view URL encoded
returnUrl:/

Form Data
view URL encoded
username:user
password:pass
rememberMe:on

Which is the Form Data in the request, where in your test the username and words were sent as a generic:

Request Payload
username=MyUsername&password=MyPassword

Seems like a browser or extension (maybe AV, but seems unlikely) is causing the request to be malformed.

You sparked an idea, i only really use the remote host from the office, so I tried all the browsers over a mobile (4g) data connection and only chrome had issues, I did check other services that are built in a similar manor as sonarr, like SABNZBD and couch potato and they all gave the same issue but they all worked on Safari and firefox so I think we can put this issue down to network firewall @ the office (Fortigate) and Chrome funnies.

Thanks for all the help.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.