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

Webservice stop working from 30-08-19 #15385

Closed
ninefingersodnd opened this issue Sep 3, 2019 · 51 comments
Closed

Webservice stop working from 30-08-19 #15385

ninefingersodnd opened this issue Sep 3, 2019 · 51 comments
Labels
1.7.6.0 Affects versions 1.7.6.1 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Regression Type: regression Trivial Severity: trivial bug > https://build.prestashop.com/news/severity-classification Webservice Label: Which BO under menu is concerned
Milestone

Comments

@ninefingersodnd
Copy link

Describe the bug
Webservice does not work anymore from 30-08-2019, We do not have changed anything, we got the error on 2 differed servers.

The error: Please activate the 'mod_auth_basic' Apache module to allow authentication of PrestaShop's webservice.

Cant get it working anymore.

But the mod is activated and working. We use FPM served by apache.
We have plesk onyx installed.

To Reproduce
Steps to reproduce the behavior:

  1. Go to webservice
  2. see error; mod_auth_basic needs to be activated.

Additional information
PrestaShop version: 1.7.6.0 and 1.7.6.1
PHP version: 7.2.22 - FPM apache
Plesk: Onyx 17.8.11

@khouloudbelguith
Copy link
Contributor

Hi @ninefingersodnd,

I did not manage to reproduce the issue with PS1.7.6.1.
It is OK
https://drive.google.com/file/d/18uIdif_JeOWJi4C4GpkbS1I21jcYcEUL/view
Could you please try to create a check_phpinfo.php file and Write this PHP Code:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Then Navigate to Url like www.example.com/check_phpinfo.php and It will show you PHP file in the server
A similar issue solved by the server: #15283
Thanks!

@khouloudbelguith khouloudbelguith added 1.7.6.1 Affects versions BO Category: Back Office Bug Type: Bug NMI Status: issue needs more information Webservice Label: Which BO under menu is concerned labels Sep 3, 2019
@ninefingersodnd
Copy link
Author

Hi @ninefingersodnd,

I did not manage to reproduce the issue with PS1.7.6.1.
It is OK
https://drive.google.com/file/d/18uIdif_JeOWJi4C4GpkbS1I21jcYcEUL/view
Could you please try to create a check_phpinfo.php file and Write this PHP Code:

<?php

// Show all information, defaults to INFO_ALL
phpinfo();

?>

Then Navigate to Url like www.example.com/check_phpinfo.php and It will show you PHP file in the server
A similar issue solved by the server: #15283
Thanks!

Hi,
The solution you have mentioned is change host and reinstall all modules?
I cant see a clear solution for the problem in te issue tread there? Or i'm not checking it right?

Below the PHP output:
https://www.odnd.nl/phpinfo.php

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, as you can see in your PHP info file the "mod_auth_basic" doesn't exist.
https://drive.google.com/file/d/1BjuU9us0e_cEje8fn5f66YWZ82J8x7Mn/view
Thanks to check the issue with your host & feedback.

@ninefingersodnd
Copy link
Author

@ninefingersodnd, as you can see in your PHP info file the "mod_auth_basic" doesn't exist.
https://drive.google.com/file/d/1BjuU9us0e_cEje8fn5f66YWZ82J8x7Mn/view
Thanks to check the issue with your host & feedback.

I have image from my plesk apache settings, i see that Auth_basic is enabled, or is this not the mod?
Thanks for your support!

www.imgur.com/a/81iqXvc

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, it should be a module Apache

const ISSUE_APACHE_MOD_AUTH_BASIC_NOT_AVAILABLE = 'issue_apache_mod_auth_basic_not_available';

Thanks!

@ninefingersodnd
Copy link
Author

I realy don't know wha tis happening, it worked fine, it says enabled in the apache config, but it is not on the phpinfo.

I realy dont know how i get it to work.

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, Could you please try to create this test.php script on your server to check if the mod_auth_basic is enabled

<?php
print_r(apache_get_modules());
?>

Thanks!

@ninefingersodnd
Copy link
Author

With the php code given, i'll get a error 500

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, have you tried to contact your host about this issue?
Thanks to check with them & feedback.

@ninefingersodnd
Copy link
Author

ninefingersodnd commented Sep 3, 2019

It is a Unmanaged VPS

@ninefingersodnd, as you can see in your PHP info file the "mod_auth_basic" doesn't exist.
https://drive.google.com/file/d/1BjuU9us0e_cEje8fn5f66YWZ82J8x7Mn/view
Thanks to check the issue with your host & feedback.

Just called the hosting company, It is a VPS, and it is a Apache module, not a PHP one, so this is not in phpinfo. It is enabled and should be working fine.

print_r(apache_get_modules()); just gives me a blanc page

Just tested on a fresh installation of prestashop 1.7.5.2 and there is no problem. it has begon with 1.7.6.0> - Going further, i have upgraded the clean install of 1.7.5.2 to 1.7.6.1 and the problem is there.

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, Could you please provide me the access to your shop to test it.
This is a public space.
You can provide me the credentials by email.
My address mail: khouloud.belguith@prestashop.com
Let's be safe!
Thanks!

@khouloudbelguith
Copy link
Contributor

khouloudbelguith commented Sep 4, 2019

Hi @ninefingersodnd,

As you said, in your case, Auth_basic is enbled in your apache but the mod_auth_basic is not enabled on your PHP installation.
You need to check again your host.

Thanks!

@ninefingersodnd
Copy link
Author

ninefingersodnd commented Sep 5, 2019

Hi,

Plesk itself does not handle apache_mod PHP, as apache does not aloud multiple PHP configurations.
This only works on the Vendor_OS but this is PHP 5.4.16

well as i said, it is working on the 1.7.5 version of prestashop, as i can see in the configuration of apache the module is standard loaded /etc/httpd/conf.modules.d/00-base.conf.

This file loads most of the modules included with the Apache HTTP
Server itself.

LoadModule access_compat_module modules/mod_access_compat.so
LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
LoadModule allowmethods_module modules/mod_allowmethods.so
LoadModule auth_basic_module modules/mod_auth_basic.so
LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule authn_anon_module modules/mod_authn_anon.so
LoadModule authn_core_module modules/mod_authn_core.so
LoadModule authn_dbd_module modules/mod_authn_dbd.so
#etc

@ninefingersodnd
Copy link
Author

httpd -M SSH command gives the following

auth_basic_module (shared) dit is de mod_auth_basic module and is loaded correctly

Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
access_compat_module (shared)
actions_module (shared)
alias_module (shared)
allowmethods_module (shared)
auth_basic_module (shared)
auth_digest_module (shared)
authn_anon_module (shared)
authn_core_module (shared)
authn_dbd_module (shared)
authn_dbm_module (shared)
authn_file_module (shared)
authn_socache_module (shared)
authz_core_module (shared)
authz_dbd_module (shared)
authz_dbm_module (shared)
authz_groupfile_module (shared)

@khouloudbelguith
Copy link
Contributor

Hi @ninefingersodnd,

As reported in this comment #15270 (comment)
The warning is not correct & the webservice is well working?

Thanks!

@ninefingersodnd
Copy link
Author

That is correct, the warning is a false warning of the prestashop system, and should be corrected in further versions of prestashop.

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, could you please provide a screenshot about your server information (From your BO => Advanced Parameters => Information page)

Thanks!

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, I checked again your shop & yo are using an Nginx server?
image

Thanks!

@ninefingersodnd
Copy link
Author

Well i looks like it :) Maybe that is the problem. In checking its configuration

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, thanks to provide me a screenshot about your server configuration from your BO => Advanced Parameters => Information page
In your first comment => you just said that

We use FPM served by apache.

Thanks!

@ninefingersodnd
Copy link
Author

informations

It says just apache, Yes it is FPM-Apache

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, I checked your shop again & the response server is Nginx.
image
It should Apache like in my case
image

Could you please check with your host & feedback.

@ninefingersodnd
Copy link
Author

Hi,

The nginx is a reverse proxy server, has no effect on the Apache module handlers,
As proof i have set the service for this handler on off.

I get a fault on the webservice js script see:

informations

@khouloudbelguith
Copy link
Contributor

@ninefingersodnd, Could you please try to follow these steps:

  1. go to Network tab
  2. Reload your page
  3. wait for your error, you should see red request information in Network tab
  4. click on it, you should see the error message in "Response" or "Preview" tab

Thanks!

@ninefingersodnd
Copy link
Author

@ninefingersodnd, Could you please try to follow these steps:

  1. go to Network tab
  2. Reload your page
  3. wait for your error, you should see red request information in Network tab
  4. click on it, you should see the error message in "Response" or "Preview" tab

Thanks!

I do not know wat your mean,
you can reproduce, your login credentials are still valid.

just go to webservice in presta and hit inspect.

@PierreRambaud PierreRambaud moved this from In progress to To be reviewed in PrestaShop 1.7.6 Sep 27, 2019
@marionf marionf moved this from To be reviewed to To be tested in PrestaShop 1.7.6 Sep 27, 2019
@IlPizza79
Copy link

Hi, I've noticed this issue is in "To be tested" step since 3 days... can you please tell us how it's going? Can you tell us when an update will be released? Or at least can you tell us a fix for current Prestashop version? Thanks in advance!

@peorthyr
Copy link

peorthyr commented Oct 1, 2019

Good day all.
We are getting this issue on all our websites that are on a specific hosting (which has already told us that the "mod_auth_basic" is not an option on the plan of the hosted sites.

Since this regression is affecting most (if not all) the websites we are managing, I'd like to understand what we could do, what I understand is that we got 3 options:

  1. Downgrade Prestashop to 1.7.5 (which was working without problems on the very same hosting)
  2. Wait for the patch (but in this case I really need to know how long does it will take).
  3. try to patch somehow Presashop waiting for the official release.

since the option 2 could take a log time, I'd like to know if there is a standard procedure to downgrade Prestashop to the 1.7.5.
or if there is some hotfix, hack, or strange idea that could work in order to make this thing working again.
thanks in advance.

Good day again.
I see there where updates on the card, may I ask you if it's possible to have an answer to one of my questions related to this topic?
we are trying to understand "what to say to our clients" and we are blocked on "we are trying to figure out what Prestashop developers are doing" and this is a little vague.
I'm not asking for a solution or for a rush in any case, just something I can say regarding the points discussed above.

@khouloudbelguith
Copy link
Contributor

@peorthyr, the fix is in progress, the issue will be fixed in the next patch 1.7.6.2.

THanks!

@IlPizza79
Copy link

Hi khouloudbelguith, can you please give us an approximate estimate of the release date?
Thanks in advance!

@khouloudbelguith
Copy link
Contributor

@peorthyr, PS1.7.6.2, if all regressions are fixed
https://github.com/PrestaShop/PrestaShop/milestone/57
And the patch should be tested then released.

Thanks!

@IlPizza79
Copy link

Sorry to bump again... any news?
Since last update, we still can't use webservice on our website... and that's frustrating :-(

@PierreRambaud
Copy link
Contributor

Since these are just warning in back office, I don't understand why you can't use webservices? 🤔

@IlPizza79
Copy link

Since these are just warning in back office, I don't understand why you can't use webservices? 🤔

You know, you're right :-)
I must apologize, my webservice were really broken but it wasn't Prestastashop fault. After reading your comment I double checked my server configuration and I found out that it was just a misconfiguration. My fault :-(

I REALLY thank you for your comment, you've pointed me in the right direction :-)

@PierreRambaud
Copy link
Contributor

@IlPizza79 At least because of you, we improve our warnings messages 😅
Thanks for your contribution!

@marionf marionf removed the develop Branch label Oct 4, 2019
@marionf marionf moved this from To be tested to To be reviewed in PrestaShop 1.7.6 Oct 4, 2019
@marionf marionf moved this from To be reviewed to To be merged in PrestaShop 1.7.6 Oct 4, 2019
@marionf marionf added Fixed Resolution: issue closed because fixed and removed Ready Status: Issue is ready to be worked on labels Oct 4, 2019
@marionf marionf added this to the 1.7.6.2 milestone Oct 4, 2019
@marionf marionf closed this as completed Oct 7, 2019
PrestaShop 1.7.6 automation moved this from To be merged to Done Oct 7, 2019
@ManuBZL
Copy link

ManuBZL commented Oct 28, 2019

I have more or less the same issue. I have installed PS 1.7.6.1 and the webservice does not work.
I try to test the webservice going to: https://mydomain.xyz/api . The web prompts the classic login asking for the webservice key, when I put the key in the "user" input does nothing. It asks me again and again like an infinite loop.

I have PHP 7.1.32 and Apache/2.4.6 runing on nginx as reverse proxy like @ninefingersodnd.
The backoffice shows the same error about activate "mod_auth_basic" but is not only a warning, webservice is not working.

I checked the httpd logs and shows nothing relevant... i do not know what to do. I am working in a new project with presta 1.7 and i can't get it working.

I tried fresh install of ps 1.7.6.0 and 1.7.6.1, same results...

@PierreRambaud
Copy link
Contributor

The backoffice doesn't display an error. It's a warning, this isn't the same thing.
More, warnings messages on back office are not triggered while running webservices features.
You need to wait for 1.7.6.2 to don't have these warnings :)

@ManuBZL
Copy link

ManuBZL commented Oct 29, 2019

I know is a warning, but the webservice is not working. That's what i'm trying to say

@IlPizza79
Copy link

Try to add following code in your htaccess:
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

Follow this tutorial, it may help you as it helped me :-)
https://www.emanuelefantin.it/blog/view/correggere-l-errore-bad-auth-key-per-le-api-di-prestashop-1753

@ManuBZL
Copy link

ManuBZL commented Oct 30, 2019

OK. thank you. Seems to work. Is something related to the htaccess file generated by prestashop.

@IlPizza79
Copy link

I guess it's not strictly related to the htaccess generated by prestashop, I think it's more an hosting isuue. I had the same website on two different hostings and one of them was working without any issue, the other one needs the new rule in htaccess.

@ManuBZL
Copy link

ManuBZL commented Oct 30, 2019

Yeah, maybe. But with presta 1.6 same server, I do not have that problem.

@caygri
Copy link

caygri commented Nov 20, 2019

any update?

@ManuBZL
Copy link

ManuBZL commented Nov 20, 2019

Yes, finally got it working. I activated "cgi mode" in the webservice options. And after several attempts, webservice began to work. Didn't need to change any configuration

@khouloudbelguith khouloudbelguith added the 1.7.6.0 Affects versions label Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.7.6.0 Affects versions 1.7.6.1 Affects versions BO Category: Back Office Bug Type: Bug Fixed Resolution: issue closed because fixed Regression Type: regression Trivial Severity: trivial bug > https://build.prestashop.com/news/severity-classification Webservice Label: Which BO under menu is concerned
Projects
No open projects
Development

No branches or pull requests

9 participants