Page 1 of 1

FTP issue - think it is my fault

Posted: Tue 28 Jun 2016 8:34 pm
by bigmac
As of Sunday morning at 4.00am, my Pi has stopped updating my website. MXDiags log is reporting "Error connecting ftp - Could not resolve host 'ftp.menstonweather.co.uk' ".
Now, I was having a problem with not being able to resolve my Pi name on my internal network and it seems this was caused by the wireless network adaptor on the Pi obtaining two IP addresses.

A bit of googling on Saturday found this https://www.raspberrypi.org/forums/view ... 8&t=111709 and I duly followed the post "by hutauf ยป Tue Jul 14, 2015 7:17 pm" which resolved the problem for me also. I rebooted the pi and everything was fine, the website continued to update without issue, until Sunday at 4.00am when I believe the Pi had a scheduled reboot.
I have tried to reverse the process by reinstalling the dhcpcd5 package but this is also throwing up an error:

"Err http://archive.raspberrypi.org/debian/ wheezy/main dhcpcd5 armhf 6.7.1-1+rpi1
Something wicked happened resolving 'archive.raspberrypi.org:http' (-5 - No address associated with hostname)
Failed to fetch http://archive.raspberrypi.org/debian/p ... _armhf.deb Something wicked happened resolving 'archive.raspberrypi.org:http' (-5 - No address associated with hostname)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?"

Running apt-get update also throws up similar messages.

So clearly I have caused an issue by playing with things I obviously don't understand........and now I don't know what to do to get back out of the problem.
Many brain cells are better than my half a brain cell, so can anyone give me any pointers?

Re: FTP issue - think it is my fault

Posted: Tue 28 Jun 2016 10:11 pm
by ConligWX
I had a similar issue on my Debian box the other week. apt-get commands kept failing. found it was the /etc/apt/sources.list had somehow become corrupt. might be worth looking there perhaps?

Re: FTP issue - think it is my fault

Posted: Wed 29 Jun 2016 1:24 pm
by bigmac
Thanks Simon.
This is what the sources.list file contains:

"deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb http://download.mono-project.com/repo/debian wheezy/snapshots/4.0.5.1/. main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ wheezy main contrib non-free rpi"

This doesn't look corrupt to me, but then i'm not sure what it is supposed to contain.
I'm sure it is because my Pi can't resolve the names through my router, although it must have the correct network info as I can access it through Putty and WinSCP, so it's not like it doesn't have a network connection.
It's as though my router isn't resolving the DNS requests back to my pi, so some network config issue between the pi and the router based on me removing the dhcpcd5 package.
I can obviously access the internet, as I am typing this, so it's not like the router doesn't have internet access.
What tests could I do from my Pi to prove this?
Still scratching my head.

Re: FTP issue - think it is my fault

Posted: Wed 29 Jun 2016 2:05 pm
by bigmac
Bingo! Found out what the issue was. For the sake of anyone else searching for the same issue, here is the solution for my problem.
It seems when you set a static IP address on the pi, you also have to set the DNS server in a file called /etc/resolvconf.conf
So, I simply replaced 127.0.0.1 with my router's IP address in the line "#name_servers=127.0.0.1" and then removed the "#" at the start of the line.

For whatever reason, the other posts I followed that talked about setting up a fixed IP address on a pi completely omitted to mention this crucial bit.

Hope that helps someone else out.