[1.7.6] Updater requires CURL

Support requests, bug reports, etc. go here. Dedicated servers / VDS hosting only
User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

[1.7.6] Updater requires CURL

Postby fox » 03 Apr 2013, 13:56

You will need CURL functions enabled in PHP to perform an in-place update of tt-rss. Otherwise it will fail with RC=2.

arkolbus
Bear Rating Trainee
Bear Rating Trainee
Posts: 12
Joined: 01 Apr 2013, 15:36

Re: [1.7.6] Updater requires CURL

Postby arkolbus » 03 Apr 2013, 17:56

I installed curl (php5-curl), but I still get a "Error while extracting tarball (RC=2)." from the in-place updater plugin (web interface).

Any ideas/suggestions would be most appreciated.

Here are the last few lines from the updater:
Proceeding to download...
Downloading distribution tarball...
Saving download to /tmp/tt-rssGe0D3o
Extracting tarball...
Error while extracting tarball (RC=2).

And here is my curl info from phpinfo:
curl

cURL support enabled
cURL Information 7.21.6
Age 3
Features
AsynchDNS No
Debug No
GSS-Negotiate Yes
IDN Yes
IPv6 Yes
Largefile Yes
NTLM Yes
SPNEGO No
SSL Yes
SSPI No
krb4 No
libz Yes
CharConv No
Protocols dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, pop3, pop3s, rtmp, rtsp, smtp, smtps, telnet, tftp
Host x86_64-pc-linux-gnu
SSL Version OpenSSL/1.0.0e
ZLib Version 1.2.3.4

Yoltie
Bear Rating Trainee
Bear Rating Trainee
Posts: 3
Joined: 03 Apr 2013, 18:21

Re: [1.7.6] Updater requires CURL

Postby Yoltie » 03 Apr 2013, 18:22

Hi,

I had the same problem. An apt-get install php5-curl does not restart apache, but just reload his conf.
Just restart manually apache : service apache2 restart

It worked on my server.

toekneebullard
Bear Rating Trainee
Bear Rating Trainee
Posts: 1
Joined: 03 Apr 2013, 18:25

Re: [1.7.6] Updater requires CURL

Postby toekneebullard » 03 Apr 2013, 18:31

fox wrote:You will need CURL functions enabled in PHP to perform an in-place update of tt-rss. Otherwise it will fail with RC=2.

Can you help a newb with how to do this in phpMyAdmin?

arkolbus
Bear Rating Trainee
Bear Rating Trainee
Posts: 12
Joined: 01 Apr 2013, 15:36

Re: [1.7.6] Updater requires CURL

Postby arkolbus » 03 Apr 2013, 20:58

Yoltie wrote:Hi,

I had the same problem. An apt-get install php5-curl does not restart apache, but just reload his conf.
Just restart manually apache : service apache2 restart

It worked on my server.


I did restart apache, just failed to mention it in my post.

toekneebullard wrote:Can you help a newb with how to do this in phpMyAdmin?

phpMyAdmin is an interface for mySQL, you can't install packages with it. Easiest way is using the package manager on your system. Assuming you're running ubuntu and have terminal access, run: "sudo apt-get install php5-curl". If that's not the case, use google.

IsaacTN
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 03 Apr 2013, 21:50

Re: [1.7.6] Updater requires CURL

Postby IsaacTN » 03 Apr 2013, 22:17

I'm also having issues with the updater, similar to the previous poster. The CURL module is installed and has been verified from phpinfo()

Note that the RC2 exit is on the tarball extraction step, not the download step.

I tried via the web and then fell back to trying via the command line to try to figure out what was going on.
Here's the command output. I redirected stderr to a text file because it was generating too much error output for scrollback.

[[email protected] Tiny-Tiny-RSS-1.7.5]# sudo -u apache ./update.php --update_self 2>./update-stderr.txt
[17:35:52/26263] Warning: self-updating is experimental. Use at your own risk.
[17:35:52/26263] Please backup your tt-rss directory before continuing. Your database will not be modified.
[17:35:52/26263] Type 'yes' to continue.
yes
[17:35:54/26263] Work directory: /var/www/Tiny-Tiny-RSS-1.7.5
[17:35:54/26263] Checking for tar...
[17:35:54/26263] Checking for gunzip...
[17:35:54/26263] Checking for latest version...
[17:35:54/26263] Target version: 1.7.6
[17:35:54/26263] Proceeding to download...
[17:35:56/26263] Downloading distribution tarball...
[17:35:56/26263] Saving download to /tmp/tt-rsseNCZMc
[17:35:56/26263] Extracting tarball...
[17:35:56/26263] Error while extracting tarball (RC=2).

The redirected stderr was full of permission denied messages from tar, basically for every file it tried to extract. Here's a tiny part of the output:
tar: Tiny-Tiny-RSS-1.7.6: Cannot mkdir: Permission denied
tar: Tiny-Tiny-RSS-1.7.6: Cannot mkdir: Permission denied
tar: Tiny-Tiny-RSS-1.7.6/.buildpath: Cannot open: No such file or directory
tar: Tiny-Tiny-RSS-1.7.6: Cannot mkdir: Permission denied
tar: Tiny-Tiny-RSS-1.7.6/.gitignore: Cannot open: No such file or directory
tar: Tiny-Tiny-RSS-1.7.6: Cannot mkdir: Permission denied

The permissions on /var/www/Tiny-Tiny-RSS-1.7.5 were recursively changed to apache.apache, so if it were writing into the existing install directory it would have had permissions.

To see what was going on, I added a system call to pwd right before the tar extract command in plugins/updater/init.php and the working directory when the tar command is executed is the parent directory of the existing install... in this case /var/www which is owned by root.root with 755 perms, which explains the permission denied messages.

Does the updater need the parent directory of the install directory to be writable by the user who is running the updater (apache in my case), or is there a problem here with it not trying to extract into the proper directory?

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [1.7.6] Updater requires CURL

Postby fox » 03 Apr 2013, 22:21

It needs both cwd and parent to be writable by it. What's perplexing is that it should actually check for that before going forward and somehow is_writable() thinks everything is fine, but then writing fails.

IsaacTN
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 03 Apr 2013, 21:50

Re: [1.7.6] Updater requires CURL

Postby IsaacTN » 03 Apr 2013, 22:39

By default, on RHEL or Fedora installs at least, the normal parent directory (/var/www) is not going to be writable by the web server's user. You may want to make a note of this somewhere in the FAQ or other documentation to save yourself some questions. ;)

Moved it to a subdir so now it's /var/www/ttrss/Tiny-Tiny-RSS-1.7.5 and ensure that from ttrss down is owned by apache. Install gets further, but now I'm getting an unhandled exception error.

Exception: SyntaxError: Unexpected token P
Function: updateSelf/inner()

SyntaxError: Unexpected token P
at Object.parse (native)
at Ajax.Request.onComplete (http://reader.hozed.net/prefs.php:24:580)
at klass.Ajax.Request.Class.create.respondToReadyState (http://reader.hozed.net/lib/prototype.j ... 23:1617:62)
at klass.Ajax.Request.Class.create.onStateChange (http://reader.hozed.net/lib/prototype.j ... 23:1547:12)
at XMLHttpRequest.onreadystatechange (http://reader.hozed.net/lib/prototype.j ... 823:393:23)

Edit: After dismissing the exception window, the updater acts like it's still running. I opened another browser and logged in and it asked me to upgrade that database, which I did. In prefs it shows the new version, but the updater is still acting like it's running.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [1.7.6] Updater requires CURL

Postby fox » 03 Apr 2013, 22:50

I'm not adding per-distribution stuff because there's too many of them. Like I said, there is a check. I have no idea why it doesn't work, this might be some bug on my part or php being php.

IsaacTN
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 03 Apr 2013, 21:50

Re: [1.7.6] Updater requires CURL

Postby IsaacTN » 03 Apr 2013, 23:03

Sorry, I wasn't clear. I meant a note about updater needing the install dir and parent to both be writable by the httpd server's user. I know it could get a bit crazy adding notes for every distro.

Alternatively you could have it do the extract under /tmp or into a subdir of the current install, would make it more tolerant of the various setups out there.

In spite of the exception error, my install seems to be working okay.

Thanks for TTRSS btw. Great stuff, and is making my post Google Reader existence much better.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [1.7.6] Updater requires CURL

Postby fox » 03 Apr 2013, 23:07

I'l mention it in the wiki but like I said it actually checks.

Code: Select all

           if (!is_writable($work_dir) && !is_writable("$parent_dir")) {
               $user = posix_getpwuid(posix_geteuid());
               $user = $user["name"];
               array_push($log, "Both tt-rss and parent directories should be writable as current user ($user).");
               $stop = true; break;
            }


Why doesn't it wooooooork gaaaah

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [1.7.6] Updater requires CURL

Postby fox » 03 Apr 2013, 23:11

http://tt-rss.org/redmine/projects/tt-r ... -upgrading

Idea to phrase this better / clearer for dummies are appreciated.

IsaacTN
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 03 Apr 2013, 21:50

Re: [1.7.6] Updater requires CURL

Postby IsaacTN » 03 Apr 2013, 23:22

I think your && needs to be an ||. You're only matching if both aren't writable, not if one is and one isn't.

if tt-rss is installed at /var/www/tt-rss user, both /var/www and /var/www/tt-rss need to be writable.

Would be more readable as:
For example, if tt-rss is installed at /var/www/tt-rss, both /var/www and /var/www/tt-rss need to be writable by the updater user.

User avatar
fox
^ me reading your posts ^
Posts: 6318
Joined: 27 Aug 2005, 22:53
Location: Saint-Petersburg, Russia
Contact:

Re: [1.7.6] Updater requires CURL

Postby fox » 03 Apr 2013, 23:24

>I think your && needs to be an ||. You're only matching if both aren't writable, not if one is and one isn't.

And here we have a great fucking illustration on how fresh eyes help. Thanks ! I'm a retard (well known fact).

IsaacTN
Bear Rating Trainee
Bear Rating Trainee
Posts: 5
Joined: 03 Apr 2013, 21:50

Re: [1.7.6] Updater requires CURL

Postby IsaacTN » 03 Apr 2013, 23:29

LOL It's all good, glad I could help. Believe me I definitely understand. I'm a professional Linux sysadmin and hobbyist C++ and php programmer. I can't even count all of the times I've looked at a script, config file, or some other piece of code a hundred times, getting more and more frustrated sometimes to the point of screaming, and missed what should have been completely obvious from the beginning.


Return to “Support”

Who is online

Users browsing this forum: No registered users and 3 guests