# \[Solved\] Cannot install Octoprint due to network issues but network is working

**URL:** https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980
**Category:** Troubleshooting
**Created:** [24 February 2019 14:01 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980 "2019-02-24T14:01:30Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [24 February 2019 14:01 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/1 "2019-02-24T14:01:30Z")

</div>

Today I just flashed and updated the latest image of Dietpi on a Raspberry Pi 3B+. Everything went fine but cannot install Octoprint from the software optimized. I get an error like dietpi cannot reach the octoprint gihub repository url but network is correctly working.  
The raspberry pi is connected through ethernet to the router and I can check/download updates without any issues.

This is the screen I always get when attempting to install Octoprint:

![](https://i.imgur.com/3CwPMUI.jpg)

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [24 February 2019 16:19 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/2 "2019-02-24T16:19:39Z")

</div>

Garret  
Thanks for your report. Will check here.

**EDIT**

Hmm works great here:

> root@VM-Stretch:~# G\_CHECK\_URL \> [GitHub - OctoPrint/OctoPrint: OctoPrint is the snappy web interface for your 3D printer!](https://github.com/foosel/OctoPrint.git)  
> [OK] Connection test: \> [GitHub - OctoPrint/OctoPrint: OctoPrint is the snappy web interface for your 3D printer!](https://github.com/foosel/OctoPrint.git)

What happens if you try the above (outside of dietpi-software)?  
Which DNS server do you use? cat /etc/resolv.conf

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [24 February 2019 21:15 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/3 "2019-02-24T21:15:13Z")

</div>

Giving **G\_CHECK\_URL [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git)** returns the same window I showed you in my first post. For some strange reasons it seems it cannot reach the url.

While giving the cat command I get the dns server of my router which I then set with the google ones (8.8.8.🕶

```nohighlight
root@livingroom:~# cat /etc/resolv.conf
# Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)
# DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN
nameserver 192.168.1.1
root@livingroom:~#

```

I tried to reach the repository with the curl command and this was the result:

```nohighlight
root@livingroom:~# curl https://github.com/foosel/OctoPrint.git
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>
root@livingroom:~#

```

I don’t understand. I tried to install other programs via the software optimized and they installed without any problem.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [24 February 2019 22:39 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/4 "2019-02-24T22:39:07Z")

</div>

Garret  
The curl output is expected, host resolution worked fine with the Google DNS.  
You can verify again with G\_CHECK\_URL, I am pretty sure it works as well.

So in this case I would check your routers DNS settings, if it actually serves as DNS server and which uplink DNS server it uses itself. You could then also try to use the configured uplink DNS server from your router directly, perhaps this is/was temporarily or permanently down or faulty.

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [25 February 2019 12:40 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/5 "2019-02-25T12:40:42Z")

</div>

Hmm I tried again this morning but I get always the same window with the same error.

If I connect from my phone to the router via wifi, I can access that url. I have DHCP set up in the router and the google dns as primary and secondary dns. I tried to switch the google dns on my router with the cloudfare (1.1.1.1), rebooted the router and raspberry pi and still get the same error.

That is so weird…

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [25 February 2019 13:00 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/6 "2019-02-25T13:00:12Z")

</div>

Did you verify that the Pi adapts the cloudflare DNS from the router after connecting (via DHCP)?  
Note that any DHCP lease in most cases overwrites /etc/resolv.conf. It is a dynamically created file, controlled by resolvconf package which can be triggered by different sources, e.g. DHCP clients.

What you could try as well is use a static IP instead of DHCP and hard code the DNS server there. If the static IP is within the DHCP IP range and as well configured as reserved for the Pi in the router network settings, this should work well in most cases. This is how I do it here 😉.

Just to be sure, you don’t have Pi-hole installed, do you?

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [1 March 2019 13:02 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/7 "2019-03-01T13:02:08Z")

</div>

I (partially 😢 ) solved the problem by installing octoprint manually. It is so weird that when using the dietpi-software it cannot clone the git repository but if I give the command manually it works without any issues. There must be something wrong with the dietpi-software, like it connects using some other network configuration for some reason.

This was the procedure I used on a clean dietpi installation:

```nohighlight
su dietpi #octoprint needs to be later started by non-root user
cd
sudo apt-get install git python-pip virtualenv
git clone https://github.com/foosel/OctoPrint.git
cd OctoPrint/
virtualenv venv
./venv/bin/python setup.py install
./venv/bin/octoprint #starting of octoprint

```

Can you suggest an easier way to install it and have it always running when I restart dietpi? And still it would be really nice to have it installed through the software optimized… 🙄

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [6 March 2019 01:27 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/8 "2019-03-06T01:27:00Z")

</div>

Garret  
Can you please try: G\_CHECK\_URL [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git)  
So we see if wget and even our wrapper works outside of dietpi-software.

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [6 March 2019 07:58 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/9 "2019-03-06T07:58:43Z")

</div>

Hi MichaIng, thank you a lot for your message. As I said in my previous post, I had already tried that command and gives me back exactly the same error window 😢  
But I tried it again this morning and I got the same result. I really don’t understand…

![](https://i.imgur.com/N2OZUQo.jpg)

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [10 March 2019 18:08 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/10 "2019-03-10T18:08:41Z")

</div>

Okay, I have no idea why this fails in your case while it works well in other cases, especially since git clone works fine in your case as well.

You can try the naked: wget --spider [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git)

However aside from that to allow you installing OctoPrint via DietPi-Software, please open /DietPi/dietpi/dietpi-software, find the line with [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git) and remove the G\_CHECK\_URL “$INSTALL\_URL\_ADDRESS” below.

This skips the online check which is not required if you already know that git clone works.

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [10 March 2019 18:20 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/11 "2019-03-10T18:20:38Z")

</div>

Giving the wget command I get this:

```nohighlight
root@transmission:~# wget --spider https://github.com/foosel/OctoPrint.git
Spider mode enabled. Check if remote file exists.
--2019-03-10 19:19:08-- https://github.com/foosel/OctoPrint.git
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/foosel/OctoPrint [following]
Spider mode enabled. Check if remote file exists.
--2019-03-10 19:19:31-- https://github.com/foosel/OctoPrint
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

root@transmission:~#

```

In any case, thank you for the other solution of skipping if the git repository can be reached 🙂

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [10 March 2019 18:48 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/12 "2019-03-10T18:48:05Z")

</div>

Garret  
Very strange, resolving the [github.com](http://github.com) hostname times out with G\_CHECK\_URL but works with plain wget --spider.

The only thing I can imaging that the timeout value we use (5 seconds) is too short.  
Please try:

```plaintext
timeout=10 G_CHECK_URL https://github.com/foosel/OctoPrint.git

```

Or even with higher value.

Ah I see 19:19:08 and 19:19:31 as timestamps (so 23 seconds) in your error output, which is indeed veeery long.  
See my output which didn’t even take 1 second:

> root@VM-Stretch:/mnt# wget --spider \> [GitHub - OctoPrint/OctoPrint: OctoPrint is the snappy web interface for your 3D printer!](https://github.com/foosel/OctoPrint.git)  
> Spider mode enabled. Check if remote file exists.  
> –2019-03-10 19:42:15-- \> [GitHub - OctoPrint/OctoPrint: OctoPrint is the snappy web interface for your 3D printer!](https://github.com/foosel/OctoPrint.git)  
> Resolving [github.com](http://github.com) ([github.com](http://github.com))… 192.30.253.112, 192.30.253.113  
> Connecting to [github.com](http://github.com) ([github.com](http://github.com))|192.30.253.112|:443… connected.  
> HTTP request sent, awaiting response… 301 Moved Permanently  
> Location: \> [GitHub - OctoPrint/OctoPrint: OctoPrint is the snappy web interface for your 3D printer!](https://github.com/foosel/OctoPrint) \> [following]  
> Spider mode enabled. Check if remote file exists.  
> –2019-03-10 19:42:15-- \> [GitHub - OctoPrint/OctoPrint: OctoPrint is the snappy web interface for your 3D printer!](https://github.com/foosel/OctoPrint)  
> Connecting to [github.com](http://github.com) ([github.com](http://github.com))|192.30.253.112|:443… connected.  
> HTTP request sent, awaiting response… 200 OK  
> Length: unspecified [text/html]  
> Remote file exists and could contain further links,  
> but recursion is disabled – not retrieving.

Which DNS server do you use? I guess this step took so long?: Resolving [github.com](http://github.com) ([github.com](http://github.com))… 192.30.253.112, 192.30.253.113  
If you have a router that can serve as DNS server for your local network (most do), please try to use it. You could do a quick test by adding the routers IP to /etc/resolv.conf, e.g. (in my case): echo ‘nameserver 192.168.178.1’ \> /etc/resolv.conf  
If you use DHCP from the router, it should apply itself automatically as DNS server, otherwise you could try to use the DHCP service IP etc as static IP and then add the router IP as static DNS entry as well.

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [10 March 2019 19:53 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/13 "2019-03-10T19:53:52Z")

</div>

With timeout=10 I still get the error but when increasing to 60 seconds it passes the test.

I am using DHCP on my router and I have given a static ip to the raspberry pi. The router has google dns as primary dns and cloudfare as second dns.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [10 March 2019 21:14 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/14 "2019-03-10T21:14:58Z")

</div>

Garret  
Hmm do other devices in your local network as well need that long to connect to www resources? It depends on your location as well of course, but also Google DNS should be way faster since it is a mirror director that redirects to the closest actual server location near you.

> I am using DHCP on my router and I have given a static ip to the raspberry pi.

Do you mean you enabled static IP use on the Pi or you made your router assigning a “reserved” IP to the Pi, still via DHCP?

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [10 March 2019 21:28 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/15 "2019-03-10T21:28:25Z")

</div>

I have a 70mbit connection both download/upload and I think every webpage and download is quite fast.

Before I meant that the router assigns a static ip to my raspberry pi.

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [10 March 2019 21:51 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/16 "2019-03-10T21:51:34Z")

</div>

And connecting e.g. via browser to [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git) works quickly?  
Does curl [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git) work faster than the wget?

Ahhhh wait do you have IPv6 enabled or disable? If enabled did you choose to prefer IPv4?  
Could you try:  
G\_CONFIG\_INJECT ‘prefer-family[[:blank:]]=’ ‘prefer-family = IPv4’ /etc/wgetrc  
And check if the wget --spider command is faster now?

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [11 March 2019 08:03 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/17 "2019-03-11T08:03:13Z")

</div>

```nohighlight
root@transmission:~# G_CONFIG_INJECT 'prefer-family[[:blank:]]=' 'prefer-family = IPv4' /etc/wgetrc
[OK] G_CONFIG_INJECT | Desired setting in /etc/wgetrc was already set: prefer-family = IPv4

root@transmission:~# wget --spider https://github.com/foosel/OctoPrint.git
Spider mode enabled. Check if remote file exists.
--2019-03-11 08:53:57-- https://github.com/foosel/OctoPrint.git
Resolving github.com (github.com)... 192.30.253.112, 192.30.253.113
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/foosel/OctoPrint [following]
Spider mode enabled. Check if remote file exists.
--2019-03-11 08:54:17-- https://github.com/foosel/OctoPrint
Connecting to github.com (github.com)|192.30.253.112|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

root@transmission:~# curl https://github.com/foosel/OctoPrint.git
<html>
<head><title>301 Moved Permanently</title></head>
<body bgcolor="white">
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

root@transmission:~#

```

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [11 March 2019 14:22 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/18 "2019-03-11T14:22:19Z")

</div>

Garret  
Ah okay IPv4 was already preferred. I just remembered that on my VMs connecting to IPv6 addresses took a very long time before wget (and APT as well) gave up and switched to IPv4.

I mean theoretically you could try to use the IPv6 address instead and compare:  
wget --spider -6 [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git)

Did the curl command finish quickly?  
Ah and to better compare, curl should follow redirects.

So overall testing would be:

```nohighlight
time curl -L https://github.com/foosel/OctoPrint.git
time wget --spider https://github.com/foosel/OctoPrint.git
time wget --spider -6 https://github.com/foosel/OctoPrint.git

```

---

<div class="post-metadata">

### Author: ![Garret](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/g/ecc23a/32.png) [@Garret](https://dietpi.com/forum/u/Garret)
#### Post date: [11 March 2019 15:10 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/19 "2019-03-11T15:10:47Z")

</div>

MichaIng here are the results: 🙂

```nohighlight
root@transmission:~# time curl -L https://github.com/foosel/OctoPrint.git
[...]
real 0m16,955s
user 0m0,119s
sys 0m0,011s

root@transmission:~# time wget --spider https://github.com/foosel/OctoPrint.git
Spider mode enabled. Check if remote file exists.
--2019-03-11 16:00:37-- https://github.com/foosel/OctoPrint.git
Resolving github.com (github.com)... 192.30.253.113, 192.30.253.112
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://github.com/foosel/OctoPrint [following]
Spider mode enabled. Check if remote file exists.
--2019-03-11 16:01:08-- https://github.com/foosel/OctoPrint
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Remote file exists and could contain further links,
but recursion is disabled -- not retrieving.

real 0m39,830s
user 0m0,127s
sys 0m0,010s

root@transmission:~# time wget --spider -6 https://github.com/foosel/OctoPrint.git
Spider mode enabled. Check if remote file exists.
--2019-03-11 16:06:52-- https://github.com/foosel/OctoPrint.git
Resolving github.com (github.com)... failed: Temporary failure in name resolution.
wget: unable to resolve host address ‘github.com’

real 0m20,096s
user 0m0,065s
sys 0m0,009s

root@transmission:~#

```

---

<div class="post-metadata">

### Author: ![MichaIng](https://dietpi.com/forum/user_avatar/dietpi.com/michaing/32/7_2.png) [@MichaIng](https://dietpi.com/forum/u/MichaIng)
#### Post date: [11 March 2019 15:24 UTC](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980/20 "2019-03-11T15:24:02Z")

</div>

Okay there is not IPv6 address for this [github.com](http://github.com).

I am still totally wondering. All of those commands take a veeery long time. In my case all of them finish in a fraction of a second.

Something with your network setup must be wrong. Lets check if other GitHub resources and other hosts take as well that long:

```nohighlight
time wget --spider https://github.com/MichaIng/DietPi.git
time wget --spider https://dietpi.com

```

Did you try to open [https://github.com/foosel/OctoPrint.git](https://github.com/foosel/OctoPrint.git) in a browser from a desktop within the same local network? Does it open immediately or take as well so long?

[Next page](https://dietpi.com/forum/t/solved-cannot-install-octoprint-due-to-network-issues-but-network-is-working/2980.md?page=2)
