"Host name may not be null" in app

Need help? Post your questions here.

Moderator: moderators

Re: "Host name may not be null" in app

Postby oggie » Thu May 03, 2012 7:59 pm

I correct that statement. It did work, but then I went to use it and I received the 'host name may not be null' error again. So it's not a java 1.6 vs 1.7 issue.
oggie
 
Posts: 35
Joined: Sun Dec 18, 2011 2:41 am

Re: "Host name may not be null" in app

Postby oggie » Fri May 04, 2012 4:27 pm

I did some more digging, and it's obviously not even getting to the server.

I cleared the app data and it still happened. I then removed and reinstalled the subsonic app. Even using the demo server over 3g causes the null error.

So there's obviously something wrong here. Is no one able to look at this?

I'm on android v4.0.3
oggie
 
Posts: 35
Joined: Sun Dec 18, 2011 2:41 am

Re: "Host name may not be null" in app

Postby bushman4 » Fri May 04, 2012 6:01 pm

If you get the error on a stock installation of the client connecting to the demo server, there is something definitely wrong with either your client hardware or the client software with your revision of the phone.

I see you mention version 4... is that Ice Cream Sandwich? if so, there are some known issues with the Subsonic Client on ICS, and someone on the forums here has spun off a custom build of the client that is ICS compatible. Can you try that one?

Glenn
Glenn Sullivan
Subsonic 6.1.6 (Unraid Docker)
90 regular Subsonic Users

Library as of 2024-10-28:
4,527 artists
19,996 albums
282,151 songs
10201.40 GB
41,583 hours
User avatar
bushman4
 
Posts: 874
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Re: "Host name may not be null" in app

Postby oggie » Fri May 04, 2012 7:06 pm

It's not a hardware issue. It worked on the same phone until it was upgraded to 4.0.3 (ICS).

I decided to download the source and fix it. I'd commit it to the SVN repo if I had permission. The change I made was to RESTMusicService.java:
Code: Select all
Index: subsonic-android/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java
===================================================================
--- subsonic-android/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java   (revision 2981)
+++ subsonic-android/src/net/sourceforge/subsonic/androidapp/service/RESTMusicService.java   (working copy)
@@ -731,7 +731,10 @@
     private void detectRedirect(String originalUrl, Context context, HttpContext httpContext) {
         HttpUriRequest request = (HttpUriRequest) httpContext.getAttribute(ExecutionContext.HTTP_REQUEST);
         HttpHost host = (HttpHost) httpContext.getAttribute(ExecutionContext.HTTP_TARGET_HOST);
-        String redirectedUrl = host.toURI() + request.getURI();
+        String redirectedUrl = request.getURI().toString();
+        if (request.getURI() != null && !request.getURI().toString().contains(host.toURI())) {
+           redirectedUrl = host.toURI() + request.getURI();
+        }     

         redirectFrom = originalUrl.substring(0, originalUrl.indexOf("/rest/"));
         redirectTo = redirectedUrl.substring(0, redirectedUrl.indexOf("/rest/"));
oggie
 
Posts: 35
Joined: Sun Dec 18, 2011 2:41 am

Re: "Host name may not be null" in app

Postby bushman4 » Fri May 04, 2012 7:10 pm

OK, so it is not a hardware issue... it is the second choice I offered:

"...or the client software with your revision of the phone."

Good job on the fix. I would send it in a PM to Sindre if I were you...

Glenn
Glenn Sullivan
Subsonic 6.1.6 (Unraid Docker)
90 regular Subsonic Users

Library as of 2024-10-28:
4,527 artists
19,996 albums
282,151 songs
10201.40 GB
41,583 hours
User avatar
bushman4
 
Posts: 874
Joined: Thu Dec 02, 2010 1:47 pm
Location: Massachusetts, USA

Re: "Host name may not be null" in app

Postby oggie » Sat May 05, 2012 1:23 pm

I did send the patch to sindre. Hopefully he integrates it and gets an official update soon.
oggie
 
Posts: 35
Joined: Sun Dec 18, 2011 2:41 am

Re: "Host name may not be null" in app

Postby patrikputteandersson » Fri Jun 01, 2012 8:27 pm

Anyone who knows when the patch will show in a "play store near you"?
It's annoying. I have paid for this tool and now it stops working.
I don't have time to compile these things on my own.

:(
patrikputteandersson
 
Posts: 1
Joined: Fri Jun 01, 2012 8:24 pm

Re: "Host name may not be null" in app

Postby Chr96er » Tue Jun 05, 2012 12:00 am

I had exactly the same problem for a long time and couldn't figure out what the problem was as I was able to access the server before.

Long story short: The error was caused by a special character in the server url: _

I replaced the character and now it works - again :) Maybe I could help someone
Chr96er
 
Posts: 1
Joined: Mon May 28, 2012 10:55 pm

Re: "Host name may not be null" in app

Postby rox4 » Sat Jun 23, 2012 4:03 pm

I'm having the same problem to... It works perfectly on wifi, but when I try to make a sshtunnel over the 3G connection it says that "host name may not be null" ...

Any idea when the bug will be fixed¿?

Thanks....
rox4
 
Posts: 6
Joined: Mon Jul 26, 2010 10:27 am

Re: "Host name may not be null" in app

Postby GJ51 » Sat Jun 23, 2012 6:05 pm

DONE IN ANDROID 3.4
--------------------
Ensure readable text in notification when background is dark.
Fix crash when using fast scrolling.
Enable fast scrolling of playlists, search results and songs.
Improve caching of artist list.

TODO IN ANDROID 3.4
--------------------
Patch "Host name cannot be null"
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: "Host name may not be null" in app

Postby darylrue » Wed Jul 18, 2012 12:13 pm

So do I just replace the txt in this java file in windows? I tried the apks in the linked thread but do not solve host name must not be null error for me. I am running galaxy note ics and windows 7 64 bit on host.
darylrue
 
Posts: 1
Joined: Wed Jul 18, 2012 12:09 pm

Re: "Host name may not be null" in app

Postby bionicdude » Thu Aug 23, 2012 3:01 pm

I could really do with this being fixed as i can't use the service unless I'm at home and/or on wifi.
Is there a dev blog, roadmap, anything that i can follow to get an idea as to when the fix will be released?

TIA
bionicdude
 
Posts: 5
Joined: Thu Apr 26, 2012 10:50 am

Re: "Host name may not be null" in app

Postby GJ51 » Thu Aug 23, 2012 3:56 pm

Use Dsub from the market.
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

Re: "Host name may not be null" in app

Postby Ramenator » Fri Aug 31, 2012 6:12 am

Hey guys, was there ever any follow up on this?

I've tried quite a few different workarounds but nothing seems to fix the issue. I've tried my no-ip.org domain, a .subsonic.org domain, I've tried the DSub app, the Subsonic ICS app and the Subsonic app on the Play store.

Any ideas?
Ramenator
 
Posts: 4
Joined: Fri Aug 31, 2012 6:10 am

Re: "Host name may not be null" in app

Postby GJ51 » Fri Aug 31, 2012 6:33 am

I've got everything working fine on my SIII using a variant of the DSub app.

Have you tested the Dsub app on the demo server?

What king of phone?
Gary J

http://bios-mods.com
http://www.maplegrovepartners.com
http://theaverageguy.tv/category/tagpodcasts/cyberfrontiers/
User avatar
GJ51
 
Posts: 3492
Joined: Wed Oct 20, 2010 11:58 pm
Location: Western New York

PreviousNext

Return to Help

Who is online

Users browsing this forum: No registered users and 48 guests