Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to get 2.4.1 Update #478

Closed
Kymation opened this issue Nov 11, 2016 · 21 comments · Fixed by #490
Closed

Unable to get 2.4.1 Update #478

Kymation opened this issue Nov 11, 2016 · 21 comments · Fixed by #490
Assignees
Milestone

Comments

@Kymation
Copy link

After install I tried the New Version check. It first failed because the includes/OSC/Work/OnlineUpdates directory was not writeable. Most users will not know what to do about this. Shouldn't it be checked during the install process, or at least in the Admin after install? Or if not that, give the solution in the error message.

After fixing the permissions, I get a box labeled "v2.4.1 (Friday 11 November, 2016)" and containing the text "Error!" I really hate this error message. What is it saying? Is this the same error? Something else? What?

@haraldpdl
Copy link
Contributor

There are already a lot of checks occurring during the online update process. Is anything logged in the error log? A red icon should appear in the top admin menu that links to the error log page.

@Kymation
Copy link
Author

No icon visible. I'll try to attach a screenshot of the page.
screenshot_2016-11-11_11-34-40

@Kymation
Copy link
Author

Accessing the error log page manually shows the log directory but no log entries. The log directory contains a .placeholder file and nothing else.

@haraldpdl
Copy link
Contributor

Maybe the whole includes/OSC/Work directory is not writable so no error log is being written. Will look into it.

@haraldpdl haraldpdl self-assigned this Nov 11, 2016
@osc2nuke
Copy link
Contributor

Jim, did you extracted the package on your server, or did you ftp the files
and directories single?

2016-11-11 20:42 GMT+01:00 Harald Ponce de Leon notifications@github.com:

Maybe the whole includes/OSC/Work directory is not writable so no error
log is being written. Will look into it.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#478 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AE7fi1dmxD8YnKqrk0-BIBevWSG_J038ks5q9MUwgaJpZM4KwDua
.

@Kymation
Copy link
Author

The includes/OSC/Work directory was not writeable as installed. I made it writeable (recursing into all subdirectories) but the error is still there, and there is still no error log file.

My copy of PHP was lacking the zip module as well, which I assume would make it impossible to unpack the zip file that osCommerce downloads. I installed the module, but again no difference. Shouldn't the installer check for this?

@Kymation
Copy link
Author

Henry: The server is on my local box, so I unpacked the files and copied them into Apache's root directory. The server is running Apache/2.4.18 (Ubuntu) / PHP 7.1.0RC5 / MySQL 5.7.16-0ubuntu0.16.04.1 on Linux 4.4.0-21-generic kernel.

@osc2nuke
Copy link
Contributor

I only remember on my windows machine that the path to the directory had back and forward slashes in the error log before it got fixed.

When the fix was made i never checked the path.
The fix itself had nothing to do with the path.
it looked something like D:\wamp64\catalog\includes/work/OnlineUpdates /.....
However, after the fix it just worked.

@Kymation
Copy link
Author

Running on Linux here, so not a slashes problem. This is supposed to be a bare-bones server install, similar to what you would get on a VPS or dedicated server. It seems to be successful at generating bugs anyway.

@osc2nuke
Copy link
Contributor

lol

@haraldpdl
Copy link
Contributor

Could you edit admin/online_update.php lines 693 and 717 and change the error message from Error! to Error1 and Error2. Then we can see which condition is failing.

@Kymation
Copy link
Author

Error1, so Line 693.

@haraldpdl
Copy link
Contributor

haraldpdl commented Nov 11, 2016

So it passes the statement on line 674 which downloads the update, but fails the statement on line 678 which tries to apply it.

Edit: It also fails to retrieve the update log (because there is no log written maybe?) which explains just the Error! line appearing. (see, we did think of everything 😛 )

@osc2nuke
Copy link
Contributor

osc2nuke commented Nov 11, 2016

I think there is a problem with the php tag used.
change <? to <?php

Btw i never liked <? , some servers not even allow it.
So if that is the prob, there should be definitely an error in your server error logs.
Short tag for php must be enabled on some linux php distro's.

@haraldpdl
Copy link
Contributor

@Kymation
Copy link
Author

Confirm that the file is downloaded: a file named 2.4.1-update.zip is in /includes/OSC/Work/OnlineUpdates.

Confirm that the error log file is not written: the /includes/OSC/Work/Logs directory contains a .placeholder file and nothing else.

@Kymation
Copy link
Author

Henry: I replaced all of the <?= with <?php echo. No change.

I've also checked the server error log, and nothing is being logged there either.

@haraldpdl
Copy link
Contributor

@Kymation did you install oscom24 on vagrant? I just tried on vagrant with Ubuntu 16.04, PHP 7.1 RC 5, Apache 2.4, MySQL 5.5 and can confirm that the installation procedure continues if curl/gd are not available. The error log is being written to though (I did not change anything in the permissions), for example:

PHP Fatal error: Uncaught Error: Call to undefined function OSC\OM\curl_init() in /var/www/oscommerce-2.4.0/catalog/includes/OSC/OM/HTTP.php:74

The Administration Dashboard front page does not load properly due to this. We'll make this a requirement as it's needed for online updates, app installs, and payment/shipping api calls.

Adding curl to PHP makes the Administration Dashboard function as normal again. The online update routine gives me this as the first error:

PHP Fatal error: Uncaught Error: Class 'ZipArchive' not found in /var/www/oscommerce-2.4.0/catalog/admin/online_update.php:283

So yes, the zip extension should be checked for during the installation procedure and online update routine.

Adding the zip extension makes the the online update routine function as normal - no errors at all.

It's strange that no errors are being logged on your server even with correct file permissions. Maybe some ini setting is preventing the error handler to load.

@Kymation
Copy link
Author

I had to go look up Vagrant. No, I run native Linux (currently Linux Mint 18, which is Ubuntu 16.04 with some extras). I installed the latest versions of Apache, PHP, and MySQL using Apt. Once I saw the missing requirements on the installer page, I also installed the GD and cURL extensions using Apt. Once I noticed that the ZIP extension was missing, I installed that (and bzip2 for good measure).

The /includes/OSC/Work/ directory was not writeable as installed. I changed that and osC was able to download the file, but it then got no further. I have confirmed that the Work directory and all subdirectories are owned by Apache (the user is www-data) and all of the directories have permissions of 777. I've tried more normal permissions (755, 775) with no change.

I have edited the php.ini file to change all of the settings to Developer mode -- that is, all of the error reporting options, both to the log and to the screen, are turned on. This is one of the first things I did when setting up the server. I have confirmed that those settings have not changed, and that introducing an error shows up immediately on the page and in the log.

Older versions of osCommerce run correctly on this server, as does the front end of 2.4.0 Beta. This is the only function I've found that doesn't work as expected. I'll take a further look at the code in a bit -- I need to get familiar with the new code anyway. I'll post anything I find here.

@Kymation
Copy link
Author

I think I found it. This is permissions error. The update was failing on this line:
if (!FileSystem::isWritable(OSCOM::BASE_DIR . 'version.txt')) {

I gave write permissions to Apache to that file and fixed that error. Then it proceeded to fail at this line:
if (!FileSystem::isWritable($file_source, true) || !FileSystem::isWritable(dirname($file_source), true)) {

I don't know where it was trying to write something there, so I just gave Apache write permissions to everything in the www directory. Probably not a good idea in general, but it worked in this case: The update installed.

How are the write permissions set for an update? I can't see where this is being managed.

@frankludriks
Copy link

I was able to install, and subsequently update to 2.4.1, with no problem.

osCommerce Online Merchant Version: 2.4.1
HTTP Server: Apache
PHP Version: 5.6.22 (Zend: 2.6.0)
Server OS: Linux ('--enable-zip', '--with-curl=/opt/curlssl/', GD support enabled)
Server Date: 2016-11-14 17:22:25 +1100 AEDT
Database Host: localhost (127.0.0.1)
Database: MySQL 5.5.52-cll

@haraldpdl haraldpdl added this to the v2.4.2 milestone Nov 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants