API and docker error: It was not possible to parse your key

I am using a bitnami image in docker for SuiteCRM 7.12.5, and since a recent release (bitnami/suitecrm:7.12.5-debian-10-r32) I am getting a consistent error when trying to generate a token:

It was not possible to parse your key, reason: error:0909006C:PEM routines:get_name:no start line

Previously, everything was working fine. If I revert to previous version (bitnami/suitecrm:7.12.5-debian-10-r31), it works again, and it fails with every version since (as of today, bitnami/suitecrm:7.12.5-debian-10-r42).

It is not yet critically urgent, as I can stay with r31 for a while. I am just documenting this in case anyone has a similar problem, or can point me towards anything useful.

Questions

From what I could find, the error seems to indicate that the server doing the request has a certificate problem. If it was the case, it would not work by simply reverting to a previous SuiteCRM image. So this is why I am thinking it’s a bug.

I have submitted it to bitnami, but apparently they are not monitoring the page.

Expected behavior

Generally the token that is returned is like this:

{
  "token_type": "Bearer",
  "expires_in": 3600,
  "access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsImp0aSI6ImVlM2YyNzBiYzhlZjhiMTE2ZDYzMmEwMDczNTFiZGZlNThhYjI2OGJhMmZiYmIyMTFjNjFiNmZiY2Y1Njc4Mj [   redacted  ] 27oHRKXUG4tFHCcYs3SMJ_XHhTPvLdpPLvaoZ_gAdYqd0r1_zxLR4Q"
}

What happens instead

This is the error that is returned with bitnami versions since r32:

{
  "status":"rejected",
  "reason": {
    "message":"500 - {
      'error':'unknown_error',
      'message': 'It was not possible to parse your key, reason: error:0909006C:PEM routines:get_name:no start line'
      }",
    "name":"Error",
    "stack":"Error: Request failed with status code 500
    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)
    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)
    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)
    at IncomingMessage.emit (node:events:538:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)"
    }
}
1 Like

I am using a Bitnami image in Docker for SuiteCRM 8.1 (R31) and also can’t generate a token. I get the same error message:

{
    "error": "unknown_error",
    "message": "It was not possible to parse your key, reason: error:0909006C:PEM routines:get_name:no start line"
}

I guess it has something to do with PHP 8. A Docker image for SuiteCRM 8.1 (R0), using PHP 7 is working fine.

1 Like

@sebro thanks for sharing

you’re right, newer images run PHP 8, and the last version that works for me (r31) runs PHP 7.4

Same issue with Softaculus apps with PHP 8.0, SuiteCRM v8.1.3
Works fine with PHP 7.4

2 Likes

This was the exact problem! I switched to PHP7.4 and got it working!

I tested it with latest bitnami image and there are still issues with creating a token, the return from the server is a http 500 with:

{
“error”: “unknown_error”,
“message”: "It was not possible to parse your key, reason: "
}

I could not find any additional information within the logs. Is there any idea if and when this will be fixed?

Hello,

I do not use the bitnami version any longer, as it is too risky for me (and my clients): there are unexpected changes without explanation, they can be breaking changes like the API problem, and there is no way to contact anyone. Therefore I have built my own dockers, it works fine.

The API calls work perfectly on a setup with PHP 7.4, they don’t work if I upgrade to PHP 8.x

On the roadmap, it says that version 7.14 will include “Improved Support for PHP 8.0 – 8.2”, which I assume may fix this. Expected Release Date is March 2023.

Click here for roadmap

My advice is to stick to a setup with PHP 7.4 for production for now, sorry!

I think there is already an open case Generating API access token throws error:0909006C:PEM · Issue #185 · salesagility/SuiteCRM-Core · GitHub with detailed analyses how to fix it… using php7 seems to be very risky because it is out of support since 12/23

The “very risky” is debatable, if it’s only until March. There are other security measures that are available. I agree it’s not comfortable

But then the solution you link to also mentions potential side effects. I am not too happy about it either.