Virtualmin Pro Unable to Install opencart using the autoinstaller

SYSTEM INFORMATION
OS type and version RHEL 9.1
Webmin version 2.021
Virtualmin version 7.7 Pro
Related packages SUGGESTED

Hi. I have a vhost set to opencart.virtualmin.timetakernet.info . The only setting I changed from the default is to switch the PHP Version to 7.4 (as installed by following this guide: hxxps://www.virtualmin.com/documentation/web/multiplephp/ )

Downloading hxxps://github.com/opencart/opencart/releases/download/3.0.3.8/opencart-3.0.3.8.zip …
Downloading hxxps://objects.githubusercontent.com/github-production-release-asset-2e65be/2141186/82eb7fad-3aba-466e-814a-4bd5e63a79c3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230424%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230424T191107Z&X-Amz-Expires=300&X-Amz-Signature=8039c995d23a1888535e216af37071acce0af5cc36a2460aec93a175b5a86d05&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=2141186&response-content-disposition=attachment%3B%20filename%3Dopencart-3.0.3.8.zip&response-content-type=application%2Foctet-stream (16.43 MiB) …
Received 1 KiB (0 %)
Received 1.64 MiB (10 %)
Received 3.28 MiB (20 %)
Received 4.93 MiB (30 %)
Received 6.57 MiB (40 %)
Received 8.21 MiB (50 %)
Received 9.86 MiB (60 %)
Received 11.5 MiB (70 %)
Received 13.14 MiB (80 %)
Received 14.79 MiB (90 %)
Received 16.43 MiB (100 %)
… download complete.

Checking PHP modules …
Installing recommended PHP mcrypt module …
… done
… checking done
Configuring webserver PHP settings …
… already done
Restarting PHP-FPM 8.0 server …
… done
Restarting PHP-FPM 7.4 server …
… done
Now installing OpenCart version 3.0.3.8 …
Database setup failed
More information on using this script can be found at http://www.opencart.com/

Installation can be continued manually at hxxps://opencart.virtualmin.timetakernet.info//
… installation was only partially complete.
Re-loading Webmin …
… done

The other question is: Why the installer is setting the opencart config URL to hxxps://**www.**opencart.virtualmin.timetakernet.info causing the browser to not load icons due to CORS on the non-www URL? And why is the extra trailing slash getting added?

Thanks in advance.

P.S. Replaced https to hxxps, so I can post the post.

so you have enabled the database on the server
image

Database was enabled on virtualhost creation and it has created its own new database, as specified on install settings.

sorry saw the failure, I don’t have pro so I can’t even test sorry.

P.S.
hxxps://opencart.virtualmin.timetakernet.info/ working???

It’s working, but icons are not loading - first issue - they work with www, but i never specified www anywhere. Second issue, I am not able to view default login in “Scripts” on the installed thing. It says " Partial installation error Database setup failed". Third issue: If i am going to be putting clients on this server, it should work.

@staff Can you help with this? I am supposed to have some ticket support as well…

Hello,

I do not see this issue on my Alma 9. OpenCart installation worked just fine.

Can you try installing it in another browser in an incognito mode or using Virtualmin CLI? It’s not clear what is defanging the URL.

Didn’t work in another browser - same error.

As for CLI, how do i specify root domain as path(public_html)?

Does this log anywhere?

I want this to work on Redhat 9, it is a class A supported OS.

I think I know what happened.

  1. At first you wanted to install OpenCart on the default domain, where database for domain was disabled and it failed
  2. Later you went to Edit Virtual Server page and enabled MariaDB database feature
  3. Afterwards, you didn’t click Install Scripts link and just used history buttons in the browser to go back to OpenCart install page and hit enter

Is this how it was?

@Jamie, we cannot assume to use PostgreSQL if MySQL isn’t available. Now, if one doesn’t have MySQL database feature enabled and PostgreSQL is also not enabled then install script just assumes PostgreSQL. We should show an error before going to the Install Script page if database for the script is required but not available and not after install button is clicked.

@radi All you should do is to remove previously installed (failed) OpenCart script and reinstall it. It works just fine on my RHEL 9.1 box. Please let us know if that worked for you.

No. This is what happened.

  1. I point domain to server to get SSL working at creation time.
  2. I create vhost with MariaDB enabled at creation time.
  3. I click on install scripts.
  4. I install opencart and tell it to create a new database.
  5. Fails.

Alright, can I see the screenshot of Webmin / Servers ⇾ MariaDB Database Server page?

Also:

  1. What is the output of mysql --version command
  2. If you try to connect using CLI to database server using mysql -u username -p what does it output?

  1. [root@virtualmin ~]# mysql --version
    mysql Ver 15.1 Distrib 10.5.16-MariaDB, for Linux (x86_64) using EditLine wrapper

  2. My vhost’s DB username is opencart. I tried to connect with the settings from config.php in opencart, and it worked just fine. I am able to see the empty database created with the vhost and the database, which the installer setup with opencart installation.

Try creating a new domain and install OpenCart. Does it work for you then?

If it works for you with a new domain, perhaps database user password was changed outside of Virtualmin in the old domain (the one that is failing now)? If so, try going to Virtualmin / Edit Databases page with the given domain and change the password and the username.

I have tried to reproduce this issue but it works flawlessly for me on all distros I tried.

Didn’t work on a new virtualhost.

Steps:

  1. Create a new vhost
  2. Change PHP to 7.4
  3. Install script

Back button was used nowhere.

Your Store . I am using domains like this, because *.virtualmin.timetakernet.info is pointed to the server.

Do you want root password of server to investigate? Maybe it will be easier for you.

Yeah, sure PM me root login and password. I will have a look tomorrow morning.

Sent. Thank you.

@Jamie, post_http_connection makes a connection and never finishes, even though the call is successful. There should be a reasonable timeout for this function to run, which should be possible to pass as param.

Where is this located? I can try changing it for test on my instance.

@radi This is absolutely illogical why OpenCart 3.0.3.8 installation fails (hangs forever with our post_http_connection request) on RHEL 8 and 9 despite PHP version used, and work just fine in Debian/Ubuntu. Also, OpenCart 4.0.2.0 installation works perfectly fine on all distros. Installers for both 3.0.3.8 and 4.0.2.0 expect absolutely identical payload! I don’t think Virtualmin is doing something wrong here.

Although, @Jamie, what we could do to work around the problem, is to make a post_http_connection request with a timeout, and don’t do error check afterwards. Because right after a few seconds as post_http_connection is called on RHEL 8/9 when OpenCart 3.0.3.8 is being installed, it’s already finishes installation (database setup). But for some reason post_http_connection doesn’t get a response and hangs forever. Perhaps, it’s a bug in post_http_connection, maybe?

Sure we could easily do that. How long a timeout do you think it would need?