litmuschaos / litmus

Litmus helps SREs and developers practice chaos engineering in a Cloud-native way. Chaos experiments are published at the ChaosHub (https://hub.litmuschaos.io). Community notes is at https://hackmd.io/a4Zu_sH4TZGeih-xCimi3Q
https://litmuschaos.io
Apache License 2.0
4.35k stars 683 forks source link

Unable to connect to ChaosHub using LitmusPortal #2804

Open jnsrikanth opened 3 years ago

jnsrikanth commented 3 years ago

What happened: Unable to connect to the ChaosHub URI from the Litmus Portal after having forked the github chaos-charts repository to my private github user account and have provided my Github Access Token in the LitmusPortal.

What you expected to happen: Expected to connect to the ChaosHub to explore and launch ChaosExperiments from the Workflow Engine in the LitmusPortal.

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

jnsrikanth commented 3 years ago

litmus-portal-error-2

imrajdas commented 3 years ago

Hi @jnsrikanth , Can you send the git URL that you trying to add?

amityt commented 3 years ago

Hi @jnsrikanth , thanks for trying out the Litmus Portal. Can you share the portal version and the git url as mentioned by @rajdas98 .

jnsrikanth commented 3 years ago

Hi, Thanks for the quick response. The Git URL I am using to connect is https://github.com/jnsrikanth/chaos-charts and the portal version I am using is: 2.0.0-Beta5

jnsrikanth commented 3 years ago

Hi, Any updates on this issue? Please let me know. Thanks.

amityt commented 3 years ago

Hi @jnsrikanth , I was able to connect a hub with the above git url. Can you check if there is some network issue while connecting the hub. @rajdas98 Can it be related to pod permissions?

jnsrikanth commented 3 years ago

Hi @amityt I am still unable to connect to the URL above from my Litmus Portal 2.0.0-Beta5 - I am still getting the same error. I am not facing any network issue when I tried doing a "git clone" of the above URL in my AKS cluster. Can you provide any further insights? Also earlier, when we installed a Litmus Portal, a default ChaosHub used to be pre-packaged with the Litmus Portal. Now we do not have that? Are we missing any other installation steps? Please let us know. Can you help us understand better about the pod permissions? We are using an AKS Cluster and not applying any RBAC for this namespace (litmus)?

amityt commented 3 years ago

Hi @jnsrikanth, the default ChaosHub is still available with litmus-portal. If possible, can you share the pod logs of litmus-portal server? You can do kubectl logs <litmus-portal-server-pod-name> -n litmus -c graphql-server

imrajdas commented 3 years ago

Hi @jnsrikanth, If you're using the azure repository then it might not work because we're using the go-git utility to do the git operations and it doesn't support the azure repository. Issue- go-git/go-git#64

jnsrikanth commented 3 years ago

Hi @rajdas98 , please find below the logs from the litmus-portal-server on the AKS cluster.

2021/05/31 12:55:48 Connected To MONGODB 2021/05/31 12:55:49 Go Version: go1.14.15 2021/05/31 12:55:49 Go OS/Arch: linux/amd64 time="2021-05-31T12:55:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T12:55:49Z" level=info msg="Updating : []" time="2021-05-31T12:55:49Z" level=info msg="GitOps DB Sync Complete" 2021/05/31 12:55:49 connect to http://localhost:8080/ for GraphQL playground time="2021-05-31T12:55:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T12:55:49Z" level=info msg="Updating : []" time="2021-05-31T12:55:49Z" level=info msg="GitOps DB Sync Complete" 2021/05/31 12:56:25 Error getting project with query :[{members [{$elemMatch [{user_id 773e0aae-7c5b-478a-a110-9f2154b20e00} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id 9d c4349d-25fa-49a7-9792-8b2626202ae7}] 2021/05/31 12:56:26 USER JWT ERROR: token contains an invalid number of segments 2021/05/31 12:56:26 USER JWT ERROR: token contains an invalid number of segments time="2021-05-31T12:57:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T12:57:49Z" level=info msg="Updating : []" time="2021-05-31T12:57:49Z" level=info msg="GitOps DB Sync Complete" 2021/05/31 12:57:49 Error getting project with query :[{members [{$elemMatch [{user_id 773e0aae-7c5b-478a-a110-9f2154b20e00} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id 9d c4349d-25fa-49a7-9792-8b2626202ae7}] 2021/05/31 12:57:53 Error getting project with query :[{members [{$elemMatch [{user_id 773e0aae-7c5b-478a-a110-9f2154b20e00} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id 9d c4349d-25fa-49a7-9792-8b2626202ae7}] 2021/05/31 12:57:53 NEW WORKFLOW EVENT LISTENER: 9dc4349d-25fa-49a7-9792-8b2626202ae7 2021/05/31 12:57:53 NEW WORKFLOW EVENT LISTENER: 9dc4349d-25fa-49a7-9792-8b2626202ae7 2021/05/31 12:57:55 CLOSED WORKFLOW LISTENER: 9dc4349d-25fa-49a7-9792-8b2626202ae7 2021/05/31 12:57:55 CLOSED WORKFLOW LISTENER: 9dc4349d-25fa-49a7-9792-8b2626202ae7 2021/05/31 12:57:55 Error getting project with query :[{members [{$elemMatch [{user_id 773e0aae-7c5b-478a-a110-9f2154b20e00} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id 9d c4349d-25fa-49a7-9792-8b2626202ae7}] 2021/05/31 12:58:09 Error getting project with query :[{members [{$elemMatch [{user_id 773e0aae-7c5b-478a-a110-9f2154b20e00} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id 9d c4349d-25fa-49a7-9792-8b2626202ae7}] 2021/05/31 12:58:12 Error getting project with query :[{members [{$elemMatch [{user_id 773e0aae-7c5b-478a-a110-9f2154b20e00} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id 9d c4349d-25fa-49a7-9792-8b2626202ae7}] time="2021-05-31T12:59:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T12:59:49Z" level=info msg="Updating : []" time="2021-05-31T12:59:49Z" level=info msg="GitOps DB Sync Complete" 2021/05/31 13:00:23 USER JWT ERROR: token contains an invalid number of segments 2021/05/31 13:00:23 USER JWT ERROR: token contains an invalid number of segments 2021/05/31 13:00:36 Error getting project with query :[{members [{$elemMatch [{user_id 0e6771ff-d8b5-4d5f-847a-9d30f3290ea3} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id }] 2021/05/31 13:00:56 Error getting user with username: admin error: mongo: no documents in result 2021/05/31 13:00:56 Error getting user with username: admin error: mongo: no documents in result 2021/05/31 13:00:56 Cloning https://github.com/litmuschaos/chaos-charts 2021/05/31 13:00:56 Starting self deployer 2021/05/31 13:00:56 NEW CLUSTER REGISTERED : ID-132cf837-6ad1-483f-bd50-385218101eaf PID-dee582ca-83eb-4c27-97eb-a41e11ce18b1 2021/05/31 13:00:56 Server endpoint: http://obs-monitoring-az.crd.com/backend/query 2021/05/31 13:00:56 Already exists 2021/05/31 13:00:57 Resource successfully created 2021/05/31 13:00:57 Already exists 2021/05/31 13:00:57 Error getting project with query :[{members [{$elemMatch [{user_id 0e6771ff-d8b5-4d5f-847a-9d30f3290ea3} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id }] 2021/05/31 13:00:57 Already exists 2021/05/31 13:00:57 Already exists

jnsrikanth commented 3 years ago

Here is the follow-up set of logs from the same log file. I did not want to dump all the logs in one message, hence.

time="2021-05-31T13:07:49Z" level=info msg="Updating : []" time="2021-05-31T13:07:49Z" level=info msg="GitOps DB Sync Complete" time="2021-05-31T13:09:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T13:09:49Z" level=info msg="Updating : []" time="2021-05-31T13:09:49Z" level=info msg="GitOps DB Sync Complete" time="2021-05-31T13:11:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T13:11:49Z" level=info msg="Updating : []" time="2021-05-31T13:11:49Z" level=info msg="GitOps DB Sync Complete" time="2021-05-31T13:13:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T13:13:49Z" level=info msg="Updating : []" time="2021-05-31T13:13:49Z" level=info msg="GitOps DB Sync Complete" Error in cloningError in cloningFile reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory time="2021-05-31T13:14:01Z" level=info msg="Executed isRepositoryExists()... " repositoryExists=false time="2021-05-31T13:14:01Z" level=error msg="Get \"https://github.com/jnsrikanth/chaos-charts.git/info/refs?service=git-upload-pack\": EOF" Error in cloningFile reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory time="2021-05-31T13:14:11Z" level=info msg="Executed isRepositoryExists()... " repositoryExists=false time="2021-05-31T13:14:11Z" level=error msg="Get \"https://github.com/jnsrikanth/chaos-charts.git/info/refs?service=git-upload-pack\": EOF" Error in cloningFile reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory Error in cloningFile reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/AlphaHub/charts/: no such file or directory time="2021-05-31T13:15:34Z" level=info msg="Executed isRepositoryExists()... " repositoryExists=false time="2021-05-31T13:15:34Z" level=error msg="Get \"https://github.com/jnsrikanth/chaos-charts.git/info/refs?service=git-upload-pack\": EOF" Error in cloningFile reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/AlphaHub/charts/: no such file or directory File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/AlphaHub/charts/: no such file or directory time="2021-05-31T13:15:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T13:15:49Z" level=info msg="Updating : []" time="2021-05-31T13:15:49Z" level=info msg="GitOps DB Sync Complete" 2021/05/31 13:17:27 Error getting project with query :[{members [{$elemMatch [{user_id 0e6771ff-d8b5-4d5f-847a-9d30f3290ea3} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id }] 2021/05/31 13:17:28 Error getting project with query :[{members [{$elemMatch [{user_id 0e6771ff-d8b5-4d5f-847a-9d30f3290ea3} {role [{$in [Owner Editor Viewer]}]} {invitation Accepted}]}]} {_id }] 2021/05/31 13:17:36 NEW WORKFLOW EVENT LISTENER: dee582ca-83eb-4c27-97eb-a41e11ce18b1 2021/05/31 13:17:36 NEW WORKFLOW EVENT LISTENER: dee582ca-83eb-4c27-97eb-a41e11ce18b1 2021/05/31 13:17:38 CLOSED WORKFLOW LISTENER: dee582ca-83eb-4c27-97eb-a41e11ce18b1 2021/05/31 13:17:38 CLOSED WORKFLOW LISTENER: dee582ca-83eb-4c27-97eb-a41e11ce18b1 File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/AlphaHub/charts/: no such file or directory time="2021-05-31T13:17:47Z" level=info msg="Executed isRepositoryExists()... " repositoryExists=false time="2021-05-31T13:17:47Z" level=error msg="Get \"https://github.com/jnsrikanth/chaos-charts.git/info/refs?service=git-upload-pack\": EOF" Error in cloningFile reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/MyHub/charts/: no such file or directory File reading error open /tmp/version/dee582ca-83eb-4c27-97eb-a41e11ce18b1/AlphaHub/charts/: no such file or directory time="2021-05-31T13:17:49Z" level=info msg="Running GitOps DB Sync..." time="2021-05-31T13:17:49Z" level=info msg="Updating : []" time="2021-05-31T13:17:49Z" level=info msg="GitOps DB Sync Complete"

amityt commented 3 years ago

Thanks @jnsrikanth for sharing the logs. Can you try the following methods:

  1. Connect a hub with http instead of https in the url?
  2. Try to connect a private chaos-charts repository using ssh-key and ssh url.
jnsrikanth commented 3 years ago

Hi @amityt - No luck so far. Tried with all the options below:

  1. Public Repository with http and https based URL - Did Not Work
  2. Private Github Repo with http and https - and with both SSH key and Personal Access Token - Did Not Work.
  3. Went for a Public Repo from our Enterprise Github Account that is accessible from our AKS cluster - Did Not Work. I am attaching a screenshot for the Option 3 above.

We are running out of ideas. Maybe there is a better and a simpler way to add a ChaosHub? Or is there any access restriction from our end? Not sure at this time.

jnsrikanth commented 3 years ago

Updating the Image here. chaoshub

jnsrikanth commented 3 years ago

@amityt - any further pointers for us ? Does the above error give any insight into it?

amityt commented 3 years ago

Hi @jnsrikanth Can I know if the AKS cluster where you have Litmus Portal is private or not? If possible, can you try to exec into the litmus-portal-server and curl .

jnsrikanth commented 3 years ago

@amityt yes the AKS cluster is private and I am able to exec into the portal-server, however, the curl command is not available and I am unable to install essential utils in the container. Any further pointers please?

zot24 commented 1 year ago

I'm having a similar issue x509 cert... on my end any ideas what could it be? I'm running Litmus locally on the latest version beta7