Dietpi: Couldn't access raspbian.raspberrypi.org | Static address issue

Created on 5 Jan 2020  ·  18Comments  ·  Source: MichaIng/DietPi

  • Date | Sun 14 Jul 17:26:01 BST 2019
  • Bug report | N/A
  • DietPi version | v6.25.3 (MichaIng/master)
  • Img creator | DietPi Core Team
  • Pre-image | Raspbian Lite
  • SBC device | RPi (armv7l) (index=-1)
  • Kernel version | #1244 SMP Thu Jul 4 18:48:07 BST 2019
  • Distro | buster (index=5)
  • Command | Connection test: http://raspbian.raspberrypi.org/raspbian/
  • Exit code | 4
  • Software title | DietPi-Login

Steps to reproduce:

  1. Flash the latest DietPi on a mini SD card
  2. Set up the config files for a working WiFi connection and a static IP address
  3. Boot it up
  4. After 5 minutes, log in through SSH

Expected behaviour:

  • I honestly have no idea, this is my first time using DietPi
  • Probably its just meant to boot normally

Actual behaviour:

  • I connect to my RBPi 4 with a fresh install of DietPi (after following the Starter Guide) through SSH
  • It immediately starts to load DietPi-Login
  • DietPi errors out

Extra details:

  • ...

Additional logs:

Log file contents:
Spider mode enabled. Check if remote file exists.
--2019-07-14 17:25:37--  http://raspbian.raspberrypi.org/raspbian/
Resolving raspbian.raspberrypi.org (raspbian.raspberrypi.org)... failed: Connection timed out.
wget: unable to resolve host address ‘raspbian.raspberrypi.org’

EDIT: This also happens when running dietpi-software

Most helpful comment

Yes, I was aware of that. Forgot to say that I cannot access my router's panel as my whole family has forgotten the password AND username. And we really don't want to reset.

All 18 comments

I noticed that anything trying to access http://raspbian.raspberrypi.org/raspbian/raspbian will not work. I can access it through my computer though.

@acryllect
Many thanks for your report.

If SSH works, the WiFi connection is fine at least.

Resolving raspbian.raspberrypi.org (raspbian.raspberrypi.org)... failed: Connection timed out.

This means DNS resolving failed. As you set up a static IP address, which DNS server did you choose? Generally I would use DHCP first and apply the given IP, gateway and DNS server, received by DHCP, as static entries afterwards via dietpi-config > Network Settings: Adapters. However you can change it now and try some generic functional solution like Cloudflare or Google DNS. In most cases simply using the IP of your router/gateway works as well and best, since most routers allow to resolve DNS for the local network and have a cache etc included.

NB: Changing network adapter settings will drop network connection, hence SSH 😉. To test a different DNS server manually, you can edit /etc/resolv.conf and change the nameserver IP to 1.1.1.1 (Cloudflare) or 8.8.8.8 (Google) or something else.

My current DNS is 8.8.8.8. I don't fully understand what you mean. I could try changing it to 1.1.1.1 but if I run /etc/resolv.conf i get a permission denied so I'm guessing I'll have to manually change it in the SD card.

Edit: Just wanted to add that I did try making the max timeout 20 seconds as opposed to 5 but nothing changed.

Thanks for the suggestion, but changing the DNS (8.8.8.8 Google -> 1.1.1.1 Cloudflare) did not fix the issue.

can you try to ping google.com? just to check if DNS resolution is working.

I run /etc/resolv.conf i get a permission denied

Which user you are using to login to DietPi? Pls use root user. This should allow to edit the file
nano /etc/resolv.conf

Tried pinging google.com, errored out the same way.
I'm using the root user

using root should not prevent you from changing the file. Pls run nano /etc/resolv.conf

@acryllect
I meant to edit the file via nano /etc/resolv.conf, which must be done as root user or sudo nano /etc/resolv.conf. However you tried that without success.

Edit: Just wanted to add that I did try making the max timeout 20 seconds as opposed to 5 but nothing changed.

I've overseen the timeout, hence raising it from default 5 to 20 seconds was a good idea 👍. However if ping fails as well (which does not respect our internal timeout setting), then most likely it is not a DNS issue but a connectivity issue (connection the www only, since connection to local network is fine). To test that, run: ping 1.1.1.1

If I run nano /etc/resolv.conf I only see one line which is nameserver 1.1.1.1.
However when running ping 1.1.1.1 I got the following error over and over until I just decided to hit ctrl+c (to interrupt the command):

root@DietPi:~# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
From 192.168.1.20 icmp_seq=1 Destination Host Unreachable
From 192.168.1.20 icmp_seq=2 Destination Host Unreachable
From 192.168.1.20 icmp_seq=3 Destination Host Unreachable
etc... for all other icmp_seq=number

So this is the likely issue @MichaIng pointed out in the latest comment but as a new Pi user myself, I have close to no clue how to fix this.

Edit: forgot to add the ping statistics

--- 1.1.1.1 ping statistics ---
43 packets transmitted, 0 received, +40 errors, 100% packet loss, time 654ms
pipe 4

looks like your Gateway settings are not correct. Therefore your Pi is not able to connect to the internet. pls go to

  1. run dietpi-config on command line
  2. Goto number 7 Network Options: Adapters
  3. Goto WiFi
  4. Check your Static Gateway IP address. Usually it should point to your Internet Router. I assume it's 192.168.1.1 but you can check settings on your workstation computer 😃
  5. In your case it might be better die switch to DHCP in first place to get your system working. It can be reverted back later on.
  6. once done, hit Apply to save your settings

hopefully you should be able to ping 1.1.1.1 now

Issue has been fixed! What I did: (everything was done through SSH)

  1. Ran dietpi-config
  2. Went to n. 7 Network Options: Adapters
  3. Went to WiFi
  4. Fixed my Static Gateway IP address (192.168.0.1 -> 192.168.1.1 which was my router's private IP, checked it before changing)
  5. Hit Apply and restarted networking
  6. Waited for completion, then rebooted
    Didn't even have to try ping 1.1.1.1, as soon as I connected to my Pi it started DietPi-Login which gave no error whatsoever. I'm now running a fully functional, minimal install of DietPi! Thank you @MichaIng and @Joulinar for helping me out :)

@acryllect
Great, sometimes it is that simple. Yeah this is why I always recommend to use DHCP first and apply received values as static IP afterwards, so one can be sure they are correct 😉.

Unfortunately I kind of had no option, I had to set a static IP in the dietpi first boot config file because I have a headless setup. I'm having other issues now but it's software related so we'll see if I can figure it out myself or I'll have to post another thread (hopefully not). Cheers!

well there is no need for Static IP address, even on headless systems DHCP is working fine. You would just need to check on your DHCP Server/ Internet Router, which IP was assigned. Usually all my systems running in headless mode right from the beginning.

Yes, I was aware of that. Forgot to say that I cannot access my router's panel as my whole family has forgotten the password AND username. And we really don't want to reset.

you could try running nslookup dietpi on your workstation computer to check the assigned IP address.

Jep or check the assigned IPs on other hosts and test ping or SSH connection to IPs, counting up the last triple. Usually DHCP servers just use the one higher than the highest already reserved/assigned IP. However most importantly its working now 😄.

@acryllect

I cannot access my router's panel as my whole family has forgotten the password AND username. And we really don't want to reset.

Not sure how old your internet router is or how long it is already running, but might be that your vendor has released some updates/security patches in meantime. So probably you should consider to reset to get it updated. 😉

Was this page helpful?
0 / 5 - 0 ratings