thoth-station / ttm-as-a-service

This is a service that implements the time to merge model (ttm)
GNU General Public License v3.0
0 stars 3 forks source link

Failed to read env GITHUBAPP_KEY variable #26

Closed shreekarSS closed 1 year ago

shreekarSS commented 2 years ago

Bug description

Failed to read GITHUBAPP_KEY private key which is set in .env file

ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=75497574, lib=9, reason=102, reason_text=b'error:04800066:PEM routines::bad end line')])

Steps to Reproduce

Steps to reproduce the behavior:

  1. Set up ttm as service github app to the repo which needs prediction
  2. Open pull request with the desired changes

Actual behavior

Error from github app Recent Deliveries:

<!doctype html>

500 Internal Server Error

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

Error from Webhook server: ValueError: ('Could not deserialize key data. The data may be in an incorrect format, it may be encrypted with an unsupported algorithm, or it may be an unsupported key type (e.g. EC curves with explicit parameters).', [_OpenSSLErrorWithText(code=75497574, lib=9, reason=102, reason_text=b'error:04800066:PEM routines::bad end line')]) 127.0.0.1 - - [08/Sep/2022 17:04:31] "POST / HTTP/1.1" 500 - ### Expected behavior To parse the ENV variables successfully and run webhook server for pull request event and comment on the PR with prediction
shreekarSS commented 2 years ago

Thinking to read .pem file instead of pasting it's content in env variable. WDYT? @KPostOffice @Gkrumbach07

Gkrumbach07 commented 2 years ago

reading from a .pem file is probably a better method for local development. In production, in openshift at least, it seems easier to inject an environment variable instead of placing a file in a volume in a container which we then pass a path too.