turbot / steampipe-plugin-github

Use SQL to instantly query repositories, users, gists and more from GitHub. Open source CLI. No DB required.
https://hub.steampipe.io/plugins/turbot/github
Apache License 2.0
74 stars 30 forks source link

Invalid input syntax for type json error while running queries on github_commit table #56

Closed misraved closed 3 years ago

misraved commented 3 years ago

Describe the bug On running the query

select * from github_commit where repository_full_name='turbot/steampipe'

Output:

Error: invalid input syntax for type json

Steampipe version (steampipe -v) Example: v0.8.1

Plugin version (steampipe plugin list) Example: v0.6.0

To reproduce Steps to reproduce the behaviour (please include relevant code and/or commands).

Expected behaviour A clear and concise description of what you expected to happen.

Additional context Add any other context about the problem here.

misraved commented 3 years ago

Additional Observations:

  1. I looked up the JSON type columns in the github_commit table and found out that the commit column is causing the problem here(commented out other JSON type columns) https://github.com/turbot/steampipe-plugin-github/blob/main/github/table_github_commit.go#L36.
  2. This issue seems to be around the API response for this particular repository. I did not find this issue in other repositories like steampipe-plugin-github, steampipe-mod-github-sherlock, steampipe-mod-aws-compliance.
ParthaI commented 3 years ago

Not able to replicate the issue.

select * from github_commit where repository_full_name='turbot/steampipe'
+----------------------+------------------------------------------+---------------+---------------------+---------------------------------------------------------------------------------------------------
| repository_full_name | sha                                      | author_login  | author_date         | comments_url                                                                                      
+----------------------+------------------------------------------+---------------+---------------------+---------------------------------------------------------------------------------------------------
| turbot/steampipe     | 63518e0fbbb1e7582f950390598b84e49124b4ae | kaidaguerre   | 2021-10-07 10:37:37 | https://api.github.com/repos/turbot/steampipe/commits/63518e0fbbb1e7582f950390598b84e49124b4ae/com
| turbot/steampipe     | 4505caecdf9d1a4373623e1268ba4d08011c8bbb | kaidaguerre   | 2021-10-18 09:24:05 | https://api.github.com/repos/turbot/steampipe/commits/4505caecdf9d1a4373623e1268ba4d08011c8bbb/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 0a7b63ae7e7d34d8c5c7fb97e9969b4bfd261674 | kaidaguerre   | 2021-10-07 11:05:52 | https://api.github.com/repos/turbot/steampipe/commits/0a7b63ae7e7d34d8c5c7fb97e9969b4bfd261674/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 6cc3951ca0c9132476c84273c1d7d77f68296211 | pskrbasu      | 2021-10-07 14:37:03 | https://api.github.com/repos/turbot/steampipe/commits/6cc3951ca0c9132476c84273c1d7d77f68296211/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 667c3aacecf1651738a5b9b4632fdedcedccb0ba | binaek        | 2021-10-07 15:57:55 | https://api.github.com/repos/turbot/steampipe/commits/667c3aacecf1651738a5b9b4632fdedcedccb0ba/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 8b9672592bcf48e87f0fb73c2b7f3aaebdf9dcc5 | binaek        | 2021-10-06 10:36:18 | https://api.github.com/repos/turbot/steampipe/commits/8b9672592bcf48e87f0fb73c2b7f3aaebdf9dcc5/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 52458e6216ef9fe25355044e3f858c133ddb8106 | pskrbasu      | 2021-10-07 11:57:41 | https://api.github.com/repos/turbot/steampipe/commits/52458e6216ef9fe25355044e3f858c133ddb8106/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | a495d7a8430d5616b1855cce724f694c37e7c045 | pskrbasu      | 2021-10-08 13:11:44 | https://api.github.com/repos/turbot/steampipe/commits/a495d7a8430d5616b1855cce724f694c37e7c045/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 549f4a7a20d20e26e9bb48d212d85971e828b31d | kaidaguerre   | 2021-09-28 15:46:41 | https://api.github.com/repos/turbot/steampipe/commits/549f4a7a20d20e26e9bb48d212d85971e828b31d/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 1d857931c70c3f8c2e3e128b553ac5516e14d461 | pskrbasu      | 2021-09-03 14:22:30 | https://api.github.com/repos/turbot/steampipe/commits/1d857931c70c3f8c2e3e128b553ac5516e14d461/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | b453188f572a73fe1a19bfcda7ce034c954c276c | kaidaguerre   | 2021-09-27 12:50:25 | https://api.github.com/repos/turbot/steampipe/commits/b453188f572a73fe1a19bfcda7ce034c954c276c/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | c65e116a3175d36040b964a08ed72d2bea62f60f | binaek        | 2021-10-05 12:43:16 | https://api.github.com/repos/turbot/steampipe/commits/c65e116a3175d36040b964a08ed72d2bea62f60f/com
|                      |                                          |               |                     |                                                          
select * from github_commit where repository_full_name='turbot/steampipe'
+----------------------+------------------------------------------+---------------+---------------------+---------------------------------------------------------------------------------------------------
| repository_full_name | sha                                      | author_login  | author_date         | comments_url                                                                                      
+----------------------+------------------------------------------+---------------+---------------------+---------------------------------------------------------------------------------------------------
| turbot/steampipe     | cb6b4d25b8efb59bf949f66f92f7fa2da8de4c6c | kaidaguerre   | 2021-10-05 11:58:10 | https://api.github.com/repos/turbot/steampipe/commits/cb6b4d25b8efb59bf949f66f92f7fa2da8de4c6c/com
| turbot/steampipe     | 52458e6216ef9fe25355044e3f858c133ddb8106 | pskrbasu      | 2021-10-07 11:57:41 | https://api.github.com/repos/turbot/steampipe/commits/52458e6216ef9fe25355044e3f858c133ddb8106/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | a495d7a8430d5616b1855cce724f694c37e7c045 | pskrbasu      | 2021-10-08 13:11:44 | https://api.github.com/repos/turbot/steampipe/commits/a495d7a8430d5616b1855cce724f694c37e7c045/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 6cc3951ca0c9132476c84273c1d7d77f68296211 | pskrbasu      | 2021-10-07 14:37:03 | https://api.github.com/repos/turbot/steampipe/commits/6cc3951ca0c9132476c84273c1d7d77f68296211/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 4505caecdf9d1a4373623e1268ba4d08011c8bbb | kaidaguerre   | 2021-10-18 09:24:05 | https://api.github.com/repos/turbot/steampipe/commits/4505caecdf9d1a4373623e1268ba4d08011c8bbb/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | a826f9fc0171a54b704c29503f7aa6f2f393e087 | kaidaguerre   | 2021-09-29 20:07:56 | https://api.github.com/repos/turbot/steampipe/commits/a826f9fc0171a54b704c29503f7aa6f2f393e087/com
| turbot/steampipe     | 0cbb6be8f83bd7f04e7f0534c4bfed978fd9cc99 | pskrbasu      | 2021-09-30 11:09:09 | https://api.github.com/repos/turbot/steampipe/commits/0cbb6be8f83bd7f04e7f0534c4bfed978fd9cc99/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 77fbee36092023b2c8dc1c5e4c44b490662c8f79 | kaidaguerre   | 2021-10-07 10:30:57 | https://api.github.com/repos/turbot/steampipe/commits/77fbee36092023b2c8dc1c5e4c44b490662c8f79/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 667c3aacecf1651738a5b9b4632fdedcedccb0ba | binaek        | 2021-10-07 15:57:55 | https://api.github.com/repos/turbot/steampipe/commits/667c3aacecf1651738a5b9b4632fdedcedccb0ba/com
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 38e3d5908f30e68ef389c01f5bd25837e8edfcae | kaidaguerre   | 2021-09-28 11:27:03 | https://api.github.com/repos/turbot/steampipe/commits/38e3d5908f30e68ef389c01f5bd25837e8edfcae/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 86798a764749eb45eb5081524f6ab14fa8dde597 | kaidaguerre   | 2021-09-20 11:53:01 | https://api.github.com/repos/turbot/steampipe/commits/86798a764749eb45eb5081524f6ab14fa8dde597/com
|                      |                                          |               |                     |                                                                                                   
> select * from github_commit where repository_full_name='turbot/steampipe'
+----------------------+------------------------------------------+---------------+---------------------+---------------------------------------------------------------------------------------------------
| repository_full_name | sha                                      | author_login  | author_date         | comments_url                                                                                      
+----------------------+------------------------------------------+---------------+---------------------+---------------------------------------------------------------------------------------------------
| turbot/steampipe     | 63518e0fbbb1e7582f950390598b84e49124b4ae | kaidaguerre   | 2021-10-07 10:37:37 | https://api.github.com/repos/turbot/steampipe/commits/63518e0fbbb1e7582f950390598b84e49124b4ae/com
| turbot/steampipe     | a0494168bd5d5678d4258a52e1f855a8f06b6ca4 | pskrbasu      | 2021-10-08 14:18:21 | https://api.github.com/repos/turbot/steampipe/commits/a0494168bd5d5678d4258a52e1f855a8f06b6ca4/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
| turbot/steampipe     | 48c1041c9cfa52ae2104371a7d0024709740e659 | binaek        | 2021-10-04 15:43:16 | https://api.github.com/repos/turbot/steampipe/commits/48c1041c9cfa52ae2104371a7d0024709740e659/com
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |                                          |               |                     |                                                                                                   
|                      |