Ryan780
Posts: 7
Joined: Wed Sep 06, 2017 2:12 pm

Curl Stopped Working

Mon May 06, 2019 10:34 pm

Shortly after installing the latest Raspbian build, curl just stopped working all together. I have tried to run the same command from my windows PC using curl and it works fine. yes both computers are on the same network. I tried removing curl and then reinstalling it but nothing seems to work. All i am executing is a simple get call to a local address.
curl http://{IP}/apps/api/56/devices/217/inactive?access_token={TOKEN}

Like i said, i can use the exact same command from windows and it works fine. But from my pi it gives me a Segmentation fault error.

User avatar
ScriptBasic
Posts: 919
Joined: Wed Apr 03, 2019 5:53 pm
Location: Anacortes, WA USA
Contact: Website Twitter

Re: Curl Stopped Working

Tue May 07, 2019 12:22 am

I use libcurl as an extension module on the full line of Raspberry Pi computers without issue.

rouelle
Posts: 3
Joined: Tue May 07, 2019 1:28 am

Re: Curl Stopped Working

Tue May 07, 2019 1:37 am

I do have the same problem, curl stopped working around 1600 UTC today. I have a script running every 12 hours that checked if my IP has changed and send me an email if so. I received an empty email today at 1601 UTC. I logged to the pi and I tried manually the curl command that gives me a segfault.

Raspbian GNU/Linux 9

Code: Select all

dpkg -l | grep curl
ii  curl                                  7.52.1-5+deb9u9                     armhf        command line tool for transferring data with URL syntax
ii  libcurl3:armhf                        7.52.1-5+deb9u9                     armhf        easy-to-use client-side URL transfer library (OpenSSL flavour)
ii  libcurl3-gnutls:armhf                 7.52.1-5+deb9u9                     armhf        easy-to-use client-side URL transfer library (GnuTLS flavour)
ii  python3-pycurl                        7.43.0-2                            armhf        Python bindings to libcurl (Python 3)
The same curl command works ok on Arch Linux

Code: Select all

pacman -Qs curl
local/curl 7.64.1-2
    An URL retrieval utility and library

User avatar
rpdom
Posts: 14085
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Curl Stopped Working

Tue May 07, 2019 5:03 am

It sounds like something on your system has become corrupted. It might not be curl itself, but maybe a library function it uses.

It is also possible that your Pi has been compromised, depending on how it is connected to the internet and how you have set it up.
Is your Pi connected directly to the Internet, or does it go through a router?
If it goes through a router, have you enabled port forwarding at any point?
Have you changed the "pi" default password?

Lets do some basic checks first. Please post the output of the following commands:

Code: Select all

curl -V
apt policy curl
which curl
ls -l /usr/bin/curl
sha256sum /usr/bin/curl
uname -a
Those will do for a start.
Signature is on holiday.

rouelle
Posts: 3
Joined: Tue May 07, 2019 1:28 am

Re: Curl Stopped Working

Tue May 07, 2019 12:32 pm

My locale is fr_CA.UTF-8 so the messages are in french.

Code: Select all

curl -V
Erreur de segmentation

apt policy curl
curl:
  Installé : 7.52.1-5+deb9u9
  Candidat : 7.52.1-5+deb9u9
 Table de version :
 *** 7.52.1-5+deb9u9 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
        100 /var/lib/dpkg/status

which curl
/usr/bin/curl

ls -l /usr/bin/curl
-rwxr-xr-x 1 root root 161280 fév  4 15:55 /usr/bin/curl

sha256sum /usr/bin/curl
752707106f3b95bc3e28d47333dd356595b6c470c0900126fd0aad9fd3fcd6c0  /usr/bin/curl

uname -a
Linux rpi 4.14.98-v7+ #1200 SMP Tue Feb 12 20:27:48 GMT 2019 armv7l GNU/Linux
I also notice that wget has exactly the same behavior since yesterday:

Code: Select all

wget --version
Erreur de segmentation

apt policy wget
wget:
  Installé : 1.18-5+deb9u3
  Candidat : 1.18-5+deb9u3
 Table de version :
 *** 1.18-5+deb9u3 500
        500 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages
        100 /var/lib/dpkg/status
Something has changed yesterday around or a little before 1600 UTC...

rouelle
Posts: 3
Joined: Tue May 07, 2019 1:28 am

[SOLVED] Re: Curl Stopped Working

Tue May 07, 2019 3:07 pm

I do have automatic unattended updates on the pi. I checked the apt log and found a problem with shared-mime-info package. So to correct it I did:

Code: Select all

sudo dpkg --configure -a
sudo apt-get install -f
and apt showed me a problem with shared-mime-info package

Code: Select all

Error: Sub-process /usr/bin/dpkg returned an error code (1)
so I did

Code: Select all

ls -l /var/lib/dpkg/info | grep -i shared-mime-info
and

Code: Select all

sudo mv /var/lib/dpkg/info/shared-mime-info.* /tmp
followed by

Code: Select all

sudo dpkg --configure -a
sudo apt-get install -f
and voilà, the error message is now gone. I rebooted the raspberry pi and everything is now ok :-)

User avatar
rpdom
Posts: 14085
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Curl Stopped Working

Tue May 07, 2019 4:50 pm

I'm happy that you sorted it out and thank you for letting us know the cause. :-)
Signature is on holiday.

Return to “General programming discussion”