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

Having issues with your DietPi installation, or, found a bug? Post it here.
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

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

Post by Garret »

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:
Image
Last edited by Garret on Fri Mar 01, 2019 2:02 pm, edited 1 time in total.
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: Cannot install Octoprint due to network issues but network is working

Post by MichaIng »

@Garret
Thanks for your report. Will check here.

EDIT

Hmm works great here:
root@VM-Stretch:~# G_CHECK_URL https://github.com/foosel/OctoPrint.git
[ OK ] Connection test: 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
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Cannot install Octoprint due to network issues but network is working

Post by Garret »

Giving G_CHECK_URL 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.8)

Code: Select all

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:

Code: Select all

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.
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: Cannot install Octoprint due to network issues but network is working

Post by MichaIng »

@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.
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Cannot install Octoprint due to network issues but network is working

Post by Garret »

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...
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: Cannot install Octoprint due to network issues but network is working

Post by MichaIng »

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?
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: Cannot install Octoprint due to network issues but network is working

Post by Garret »

I (partially :cry: ) 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:

Code: Select all

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... :roll:
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: [Solved] Cannot install Octoprint due to network issues but network is working

Post by MichaIng »

@Garret
Can you please try: G_CHECK_URL https://github.com/foosel/OctoPrint.git
So we see if wget and even our wrapper works outside of dietpi-software.
Garret
Posts: 52
Joined: Sat Nov 10, 2018 12:23 pm

Re: [Solved] Cannot install Octoprint due to network issues but network is working

Post by Garret »

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 :cry:
But I tried it again this morning and I got the same result. I really don't understand...

Image
User avatar
MichaIng
Site Admin
Posts: 2271
Joined: Sat Nov 18, 2017 6:21 pm

Re: [Solved] Cannot install Octoprint due to network issues but network is working

Post by MichaIng »

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

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 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.
Post Reply