Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Host or service not provided, or not known
Started by thomas6 Feb 18 2019 11:27 AM

- - - - -
7 replies to this topic
host service provided known not download ftp error
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 956 posts
  • Corona SDK

Hola!

 

I'm getting a frustrating error: I have some FTP download code which works perfectly in the simulator on my macBook Pro (build 3463), but on my iPad I get the following error code as download error:

 

Host or service not provided, or not known.

 

Any idea why this isn't working?

 

Thanks!

Thomas

 



[TOPIC: post.html]
#2

anaqim

[GLOBAL: userInfoPane.html]
anaqim
  • Contributor

  • 770 posts
  • Corona SDK

Hi, its been some time since i built for mac but I do recall that I had an issue like that.

 

I dont recall the details but it was something about how the mac understands the url and it had to be constructed slightly different to work.

 

I think it was that mac was more strict with using proper url encoded, whereas windows and the simulator was more forgiving, but I'm not 100% sure, since it's been quite some time.



[TOPIC: post.html]
#3

anaqim

[GLOBAL: userInfoPane.html]
anaqim
  • Contributor

  • 770 posts
  • Corona SDK

i now see that you're on a mac and have issues with an ipad.

should learn to read better before answering  :blink:



[TOPIC: post.html]
#4

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 956 posts
  • Corona SDK

No worries Anaqim, I appreciate that you're trying to help!

 

I know iOS has become a lot more "difficult" when it comes to using HTTP and FTP access from apps, requiring you to set exception to whitelist certain things or domains, so I'm assuming it has something to do with this ( App Transport Security Exceptions ) , but I can't find it googling, unfortunately. For HTTP, yes, for FTP, nope.

 

Haha, I almost posted my code here, 5 minutes ago, containing the login and password for my FTP! Need to remember to watch out for that ;-)



[TOPIC: post.html]
#5

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 956 posts
  • Corona SDK

Update: I just changed my code to work with a more recent domain I have, and it gives the same error.

 

Anyone? Any reason why this would work in the simulator on MacBook Pro, and not on an iOS device?



[TOPIC: post.html]
#6

anaqim

[GLOBAL: userInfoPane.html]
anaqim
  • Contributor

  • 770 posts
  • Corona SDK

hi thomas6,

 

i just saw a post which gave me a reminder as to what the issue we had was (mentioned above).

 

https://forums.coronalabs.com/topic/75027-app-rejected-on-apple-store-because-of-using-health-kit-or-carekit-api

 

at the top there is a section in the build settings for ios called "NSAppTransportSecurity". without it urls would not work. its a few years back and i think it was one of apples security inventions.

 

likely this does not relate to your error but thought i'd mention it for completeness sake  :)



[TOPIC: post.html]
#7

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,646 posts
  • Enterprise

As far as I know, ATS does not impact FTP. It impacts HTTP/HTTPS only.

 

There is a second networking issue that you could be running into. Apple requires all network connections to work over IPv6 networks. I don't know if that FTP code was ever updated (it was community contributed) to support IPv6. Maybe that would be a place to start looking.

 

Are you putting any print statements in your code looking for errors?



[TOPIC: post.html]
#8

thomas6

[GLOBAL: userInfoPane.html]
thomas6
  • Contributor

  • 956 posts
  • Corona SDK

Hi Rob, and hi Anaqim and other posters.

 

Thanks for the helping hand, and my apologies: this issue has been resolved and I failed to mention it here!

 

I can confirm that the ftp.lua code is still working, even with an IPv4 server! Frustratingly enough, after days of searching, I tried on a friends iPad (at his house), which magically worked. Then this same friend's iPad worked at my house as well, to my surprise.

 

I thought maybe it was an iOS version issue, so I tried updating and lo and behold, my iPad couldn't find Apple's update server! Turned out, in the end, that my own iPad had sort of crashed it's network protocol for some unknown reason, and all it took to fix this issue was to turn off and on the wi-fi for my iPad.

 

Yes, it all really was that stupid! Could have saved me hours of work to try this at first, but strangely enough Safari websites did work without fail (as I was using this device to search for fixes)...

 

Strange and silly, but I'm glad it's working again and I can proceed developing now. Thanks for all the help, and sorry for leading you all down the wrong debugging path!


  • anaqim likes this


[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: host, service, provided, known, not, download, ftp, error