opencobra / cobratoolbox

The COnstraint-Based Reconstruction and Analysis Toolbox. Documentation:
https://opencobra.github.io/cobratoolbox
Other
246 stars 308 forks source link

Certificates issue within postMINERVArequest #1775

Open nmendozam opened 3 years ago

nmendozam commented 3 years ago

I am running the toolbox in a Linux machine. The way to reproduce this error is by calling buildFluxDistLayout, but as this method uses postMINERVArequest internally the actual issue happens there.

I ran this line from the tutorials:

serverResponse = buildFluxDistLayout(minerva, model, solution_atp_prod_max_regularised, 'atp_prod_max_regularised3',[],'#6617B5')

And I get this error:

Index exceeds the number of array elements (1).

Error in postMINERVArequest (line 36)
    minerva_auth_token = split{2};

Error in buildFluxDistLayout (line 81)
serverResponse = postMINERVArequest(login, password, map, googleLicenseContent, identifier, content);

Upon further inspection the variable split is empty and the variable command_out has the following

'curl: (77) error setting certificate verify locations:
       CAfile: /etc/ssl/certs/ca-certificates.crt
       CApath: none
     # Netscape HTTP Cookie File
     # https://curl.haxx.se/docs/http-cookies.html
     # This file was generated by libcurl! Edit at your own risk.

     '

Expected behavior The error message should be handled correctly and printed in the console.

Workaround The issue is that my CAfile is called ca-bundle.crt instead of ca-certificates.crt, so there are two possible workarounds:

  1. In postMINERVArequest.m file replace headerlength = ' '; with headerlength = ' --cacert /etc/ssl/certs/ca-bundle.crt --capath /etc/ssl/certs ';
  2. Or make a link to the cert file with ln -s /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt

I hereby confirm that I have:

rmtfleming commented 3 years ago

Hi please post this to the cobra toolbox google group. Regards, Ronan

On Sat, 22 May 2021 at 21:36, Nicolas Mendoza @.***> wrote:

I am running the toolbox in a Linux machine. The way to reproduce this error is by calling buildFluxDistLayout, but as this method uses postMINERVArequest internally the actual issue happens there.

I ran this line from the tutorials:

serverResponse = buildFluxDistLayout(minerva, model, solution_atp_prod_max_regularised, 'atp_prod_max_regularised3',[],'#6617B5')

And I get this error:

Index exceeds the number of array elements (1).

Error in postMINERVArequest (line 36) minerva_auth_token = split{2};

Error in buildFluxDistLayout (line 81) serverResponse = postMINERVArequest(login, password, map, googleLicenseContent, identifier, content);

Upon further inspection the variable split is empty and the variable command_out has the following

'curl: (77) error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: none

Netscape HTTP Cookie File

 # https://curl.haxx.se/docs/http-cookies.html
 # This file was generated by libcurl! Edit at your own risk.

 '

Expected behavior The error message should be handled correctly and printed in the console.

Workaround The issue is that my CAfile is called ca-bundle.crt instead of ca-certificates.crt, so there are two possible workarounds:

  1. In postMINERVArequest.m file replace headerlength = ' '; with headerlength = ' --cacert /etc/ssl/certs/ca-bundle.crt --capath /etc/ssl/certs ';
  2. Or make a link to the cert file with ln -s /etc/ssl/certs/ca-bundle.crt /etc/ssl/certs/ca-certificates.crt

I hereby confirm that I have:

  • Tried to solve the issue on my own
  • Retried to run my code with the latest version of The COBRA Toolbox
  • Checked that a similar issue has not already been opened

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/opencobra/cobratoolbox/issues/1775, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAQMEOUKHNRWJQT2P7YHLX3TPAITTANCNFSM45K7IECQ .

--

Mr. Ronan MT Fleming B.V.M.S. Dip. Math. Ph.D.

Assistant Professor, Division of Systems Biomedicine and Pharmacology, Leiden Academic Centre for Drug Research, Faculty of Science, Leiden University. https://www.universiteitleiden.nl/en/staffmembers/ronan-fleming & H2020 Project Coordinator, Systems Medicine of Mitochondrial Parkinson’s Disease, http://sysmedpd.eu & Senior Lecturer, School of Medicine, National University of Ireland, Galway.

Peer-reviewed publications: https://goo.gl/FZPG23 Mobile: +353 852 109 806 Skype: ronan.fleming

(This message is confidential and may contain privileged information. It is intended for the named recipient only. If you receive it in error please notify me and permanently delete the original message and any copies.)