magit / forge

Work with Git forges from the comfort of Magit
GNU General Public License v3.0
1.31k stars 116 forks source link

error in process filter: `ghub--graphql-handle-response`: peculiar error #639

Closed benthamite closed 7 months ago

benthamite commented 7 months ago

Running forge-pull-notifications results in the following errors:

error in process filter: ghub--graphql-handle-response: peculiar error: ((message . "Parse error on \"(\" (LPAREN) at [125, 11]") (locations ((line . 125) (column . 11))))
error in process filter: peculiar error: ((message . "Parse error on \"(\" (LPAREN) at [125, 11]") (locations ((line . 125) (column . 11))))

I tried rebooting and resetting the database (via forge-reset-database) but the error persists. I'm not sure what's going on since I didn’t do anything obvious that might explain this behavior, such as updating Forge or reinstalling Emacs.

Here's the backtrace:

Debugger entered--Lisp error: (ghub-graphql-error ((message . "Parse error on \"(\" (LPAREN) at [125, 11]") (locations ((line . 125) (column . 11)))))
ghub--signal-error((ghub-graphql-error ((message . "Parse error on \"(\" (LPAREN) at [125, 11]") (locations ((line . 125) (column . 11))))))
ghub--graphql-handle-response((:peer (:certificates ((:version 3 :serial-number "0b:89:05:37:12:5f:45:10:d6:37:2a:10:28:a9:29:a5" :issuer "C=US,O=DigiCert Inc,CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1" :valid-from "2023-02-16" :valid-to "2024-03-15" :subject "C=US,ST=California,L=San Francisco,O=GitHub\\, Inc.,CN=*.github.com" :public-key-algorithm "EC/ECDSA" :certificate-security-level "High" :signature-algorithm "ECDSA-SHA384" :public-key-id "sha1:b6:3f:03:4b:19:b5:09:31:ad:35:c2:7b:0c:10:5b:e3:49:f4:14:3b" :public-key-id-sha256 "sha256:26:0e:fc:74:e1:3e:7f:27:48:1a:4d:7d:b3:05:b0:8b:2a:54:49:1e:87:59:9c:9b:7e:72:46:ff:c1:bb:a7:23" :certificate-id "sha1:2d:79:6c:90:2d:ad:8a:2e:4f:d1:e2:99:ed:e8:91:29:36:40:f8:58" :pem "-----BEGIN CERTIFICATE-----<redacted>-----END CERTIFICATE-----\n") (:version 3 :serial-number "07:f2:f3:5c:87:a8:77:af:7a:ef:e9:47:99:35:25:bd" :issuer "C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert Global Root CA" :valid-from "2021-04-14" :valid-to "2031-04-13" :subject "C=US,O=DigiCert Inc,CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1" :public-key-algorithm "EC/ECDSA" :certificate-security-level "Ultra" :signature-algorithm "RSA-SHA384" :public-key-id "sha1:3f:a4:c2:7e:9c:9c:89:2c:6b:98:6c:1c:3e:1f:40:20:49:d4:48:5f" :public-key-id-sha256 "sha256:7b:42:11:cf:94:e2:a3:71:80:d5:7b:38:7d:45:56:98:7d:71:1c:38:87:d9:d3:1b:56:d0:81:4a:43:88:76:a3" :certificate-id "sha1:ae:c1:3c:dd:5e:a6:a3:99:8a:ec:14:ac:33:1a:d9:6b:ed:bb:77:0f" :pem "-----BEGIN CERTIFICATE-----<redacted>-----END CERTIFICATE-----\n")) :certificate (:version 3 :serial-number "0b:89:05:37:12:5f:45:10:d6:37:2a:10:28:a9:29:a5" :issuer "C=US,O=DigiCert Inc,CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1" :valid-from "2023-02-16" :valid-to "2024-03-15" :subject "C=US,ST=California,L=San Francisco,O=GitHub\\, Inc.,CN=*.github.com" :public-key-algorithm "EC/ECDSA" :certificate-security-level "High" :signature-algorithm "ECDSA-SHA384" :public-key-id "sha1:b6:3f:03:4b:19:b5:09:31:ad:35:c2:7b:0c:10:5b:e3:49:f4:14:3b" :public-key-id-sha256 "sha256:26:0e:fc:74:e1:3e:7f:27:48:1a:4d:7d:b3:05:b0:8b:2a:54:49:1e:87:59:9c:9b:7e:72:46:ff:c1:bb:a7:23" :certificate-id "sha1:2d:79:6c:90:2d:ad:8a:2e:4f:d1:e2:99:ed:e8:91:29:36:40:f8:58" :pem "-----BEGIN CERTIFICATE-----<redacted>-----END CERTIFICATE-----\n") :key-exchange "ECDHE-RSA" :protocol "TLS1.3" :cipher "AES-128-GCM" :mac "AEAD" :encrypt-then-mac nil)) #s(ghub--graphql-req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/graphql" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous t) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode -0x1f60367ddb8ca69b>) :handler ghub--graphql-handle-response :unpaginate nil :noerror nil :reader nil :callback #f(compiled-function (data) #<bytecode 0x1f2c783bae81aa19>) :errorback nil :value nil :extra nil :query (query ((_Z2l0aHViLmNvbTpSX2tnRE9MT2JqNVE6OTM1MzAwNDk0Nw__ repository) [(name "boletin") (owner "tlon-team")] (issue [(number 1)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTYxMTU5MjQ5Mw__ repository) [(name "uqbar-issues") (owner "tlon-team")] (issue [(number 204)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ__ repository) [(name #("jinx" 0 4 (fontified t))) (owner #("minad" 0 5 (fontified t)))] (issue [(number 140)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id)))))) :query-str "query {\n  _Z2l0aHViLmNvbTpSX2tnRE9MT2JqNVE6OTM1MzAwNDk0Nw__: repository (name: \"boletin\",owner: \"tlon-team\") {\n    issue (number: 1) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTYxMTU5MjQ5Mw__: repository (name: \"uqbar-issues\",owner: \"tlon-team\") {\n    issue (number: 204) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ__: repository (name: #(\"jinx\" 0 4 (fontified t)),owner: #(\"minad\" 0 5 (fontified t))) {\n    issue (number: 140) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n}" :variables nil :until nil :buffer #<buffer New Issue · magit/forge> :pages 1))
url-http-activate-callback()
url-http-chunked-encoding-after-change-function(1142 1269 127)
url-http-wait-for-headers-change-function(1 1294 1293)
url-http-generic-filter(#<process api.github.com> "HTTP/1.1 200 OK\15\nServer: GitHub.com\15\nDate: Mon, 26 Feb 2024 23:46:35 GMT\15\nContent-Type: application/json; charset=utf-8\15\nTransfer-Encoding: chunked\15\nX-OAuth-Scopes: notifications, read:org, repo, user\15\nX-Accepted-OAuth-Scopes: repo\15\nX-GitHub-Media-Type: github.v4; format=json\15\nX-RateLimit-Limit: 5000\15\nX-RateLimit-Remaining: 4900\15\nX-RateLimit-Reset: 1708991404\15\nX-RateLimit-Used: 100\15\nX-RateLimit-Resource: graphql\15\nAccess-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset\15\nAccess-Control-Allow-Origin: *\15\nStrict-Transport-Security: max-age=31536000; includeSubdomains; preload\15\nX-Frame-Options: deny\15\nX-Content-Type-Options: nosniff\15\nX-XSS-Protection: 0\15\nReferrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin\15\nContent-Security-Policy: default-src 'none'\15\nVary: Accept-Encoding, Accept, X-Requested-With\15\nContent-Encoding: gzip\15\nX-GitHub-Request-Id: C40E:11A02:347EA2:3737B0:65DD22DB\15\n\15\n73\15\n\37\213\10\0\0\0\0\0\0\3\253VJ-*\312/*V\262\212\256V\312M-.NLOU\262R\nH,*NU\0K)\344\347)\304(i\304()h\370\48\6\271\372i*$\226(D\33\32\231\352(\30\32\306*\351(\345\344''\226d\346\347A\f\311\311\314\3\232\0\222VJ\316\317)\315\315\3r\fkc\201\20\0\220\262\260\314l\0\0\0\15\n0\15\n\15\n")
tarsius commented 7 months ago

Well there are two problems. Firstly we get a "peculiar error" because the ghub-graphql-error error type wasn't actually defined. I've fixed that.

Now to the real issue: Parse error on \"(\" (LPAREN) at [125, 11]. The next step is to look at the request to see why it cannot be parsed. Unfortunately there's no debug variable, so we'll have to manually add debug statement. (I think this is the first parse error I have heard about in years.)

Apply this patch:

diff --git a/lisp/ghub-graphql.el b/lisp/ghub-graphql.el
--- a/lisp/ghub-graphql.el
+++ b/lisp/ghub-graphql.el
@@ -381,6 +381,9 @@ (cl-defun ghub--graphql-retrieve (req &optional lineage cursor)
          (ghub--graphql-prepare-query
           (ghub--graphql-req-query req)
           lineage cursor)))
+  (with-current-buffer (get-buffer-create "*gsexp-encode*")
+    (erase-buffer)
+    (insert (ghub--graphql-req-query-str req)))
   (ghub--retrieve
    (let ((json-false nil))
      (ghub--encode-payload

Run another request. The buffer should now contain the last, failing request. Please post that (along with the error message, for the position we have to inspect).

benthamite commented 7 months ago

Hi @tarsius,

Here's the requested backtrace and buffer content:

Debugger entered--Lisp error: (ghub-graphql-error ((message . "Parse error on \"(\" (LPAREN) at [491, 11]") (locations ((line . 491) (column . 11)))))
ghub--signal-error((ghub-graphql-error ((message . "Parse error on \"(\" (LPAREN) at [491, 11]") (locations ((line . 491) (column . 11))))))
ghub--graphql-handle-response((:peer (:certificates ((:version 3 :serial-number "0b:89:05:37:12:5f:45:10:d6:37:2a:10:28:a9:29:a5" :issuer "C=US,O=DigiCert Inc,CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1" :valid-from "2023-02-16" :valid-to "2024-03-15" :subject "C=US,ST=California,L=San Francisco,O=GitHub\\, Inc.,CN=*.github.com" :public-key-algorithm "EC/ECDSA" :certificate-security-level "High" :signature-algorithm "ECDSA-SHA384" :public-key-id "sha1:b6:3f:03:4b:19:b5:09:31:ad:35:c2:7b:0c:10:5b:e3:49:f4:14:3b" :public-key-id-sha256 "sha256:26:0e:fc:74:e1:3e:7f:27:48:1a:4d:7d:b3:05:b0:8b:2a:54:49:1e:87:59:9c:9b:7e:72:46:ff:c1:bb:a7:23" :certificate-id "sha1:2d:79:6c:90:2d:ad:8a:2e:4f:d1:e2:99:ed:e8:91:29:36:40:f8:58" :pem "-----BEGIN CERTIFICATE-----\n<...>\n-----END CERTIFICATE-----\n") (:version 3 :serial-number "07:f2:f3:5c:87:a8:77:af:7a:ef:e9:47:99:35:25:bd" :issuer "C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert Global Root CA" :valid-from "2021-04-14" :valid-to "2031-04-13" :subject "C=US,O=DigiCert Inc,CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1" :public-key-algorithm "EC/ECDSA" :certificate-security-level "Ultra" :signature-algorithm "RSA-SHA384" :public-key-id "sha1:3f:a4:c2:7e:9c:9c:89:2c:6b:98:6c:1c:3e:1f:40:20:49:d4:48:5f" :public-key-id-sha256 "sha256:7b:42:11:cf:94:e2:a3:71:80:d5:7b:38:7d:45:56:98:7d:71:1c:38:87:d9:d3:1b:56:d0:81:4a:43:88:76:a3" :certificate-id "sha1:ae:c1:3c:dd:5e:a6:a3:99:8a:ec:14:ac:33:1a:d9:6b:ed:bb:77:0f" :pem "-----BEGIN CERTIFICATE-----\n<...>\n-----END CERTIFICATE-----\n")) :certificate (:version 3 :serial-number "0b:89:05:37:12:5f:45:10:d6:37:2a:10:28:a9:29:a5" :issuer "C=US,O=DigiCert Inc,CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1" :valid-from "2023-02-16" :valid-to "2024-03-15" :subject "C=US,ST=California,L=San Francisco,O=GitHub\\, Inc.,CN=*.github.com" :public-key-algorithm "EC/ECDSA" :certificate-security-level "High" :signature-algorithm "ECDSA-SHA384" :public-key-id "sha1:b6:3f:03:4b:19:b5:09:31:ad:35:c2:7b:0c:10:5b:e3:49:f4:14:3b" :public-key-id-sha256 "sha256:26:0e:fc:74:e1:3e:7f:27:48:1a:4d:7d:b3:05:b0:8b:2a:54:49:1e:87:59:9c:9b:7e:72:46:ff:c1:bb:a7:23" :certificate-id "sha1:2d:79:6c:90:2d:ad:8a:2e:4f:d1:e2:99:ed:e8:91:29:36:40:f8:58" :pem "-----BEGIN CERTIFICATE-----\n<...>\n-----END CERTIFICATE-----\n") :key-exchange "ECDHE-RSA" :protocol "TLS1.3" :cipher "AES-128-GCM" :mac "AEAD" :encrypt-then-mac nil)) #s(ghub--graphql-req :url #s(url :type "https" :user nil :password nil :host "api.github.com" :portspec nil :filename "/graphql" :target nil :attributes nil :fullness t :silent nil :use-cookies t :asynchronous t) :forge nil :silent nil :method "POST" :headers #f(compiled-function () #<bytecode -0x1f635f9ac0aea69b>) :handler ghub--graphql-handle-response :unpaginate nil :noerror nil :reader nil :callback #f(compiled-function (data) #<bytecode 0x13206d7a2d417699>) :errorback nil :value nil :extra nil :query (query ((_Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTY2OTQxNzg5Nw__ repository) [(name "uqbar-issues") (owner "tlon-team")] (issue [(number 209)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9LcjdrZ2c6OTY1MjAzMzA4Mg__ repository) [(name "ea.news-issues") (owner "tlon-team")] (issue [(number 7)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9KaERINmc6ODM1NDgwOTI1OA__ repository) [(name "tlon-docs") (owner "tlon-team")] (issue [(number 1)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTY1MDkyMTc4MA__ repository) [(name "uqbar-issues") (owner "tlon-team")] (issue [(number 206)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTYzNjg1MDU3OA__ repository) [(name "uqbar-issues") (owner "tlon-team")] (issue [(number 205)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9Kbl9LWWc6OTExNDAxNDM3Nw__ repository) [(name "consult-gh") (owner "armindarvish")] (issue [(number 102)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6ODg2NDAwNjY4MQ__ repository) [(name "uqbar-issues") (owner "tlon-team")] (issue [(number 123)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9MT2JqNVE6OTM1MzAwNDk0Nw__ repository) [(name "boletin") (owner "tlon-team")] (issue [(number 1)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))))) ((_Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ__ repository) [(name #("jinx" 0 4 (fontified t))) (owner #("minad" 0 5 (fontified t)))] (issue [(number 140)] number id state stateReason isReadByViewer (author login) title createdAt updatedAt closedAt locked (milestone id) body (assignees [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id))) (comments [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id databaseId (author login) createdAt updatedAt body))) (labels [(first 100)] (pageInfo endCursor hasNextPage) (edges (node id)))))) :query-str "query {\n  _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTY2OTQxNzg5Nw__: repository (name: \"uqbar-issues\",owner: \"tlon-team\") {\n    issue (number: 209) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9LcjdrZ2c6OTY1MjAzMzA4Mg__: repository (name: \"ea.news-issues\",owner: \"tlon-team\") {\n    issue (number: 7) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9KaERINmc6ODM1NDgwOTI1OA__: repository (name: \"tlon-docs\",owner: \"tlon-team\") {\n    issue (number: 1) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTY1MDkyMTc4MA__: repository (name: \"uqbar-issues\",owner: \"tlon-team\") {\n    issue (number: 206) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTYzNjg1MDU3OA__: repository (name: \"uqbar-issues\",owner: \"tlon-team\") {\n    issue (number: 205) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9Kbl9LWWc6OTExNDAxNDM3Nw__: repository (name: \"consult-gh\",owner: \"armindarvish\") {\n    issue (number: 102) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6ODg2NDAwNjY4MQ__: repository (name: \"uqbar-issues\",owner: \"tlon-team\") {\n    issue (number: 123) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9MT2JqNVE6OTM1MzAwNDk0Nw__: repository (name: \"boletin\",owner: \"tlon-team\") {\n    issue (number: 1) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n  _Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ__: repository (name: #(\"jinx\" 0 4 (fontified t)),owner: #(\"minad\" 0 5 (fontified t))) {\n    issue (number: 140) {\n      number\n      id\n      state\n      stateReason\n      isReadByViewer\n      author {\n\11login\n      }\n      title\n      createdAt\n      updatedAt\n      closedAt\n      locked\n      milestone {\n\11id\n      }\n      body\n      assignees (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n      comments (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11    databaseId\n\11    author {\n\11      login\n\11    }\n\11    createdAt\n\11    updatedAt\n\11    body\n\11  }\n\11}\n      }\n      labels (first: 100) {\n\11pageInfo {\n\11  endCursor\n\11  hasNextPage\n\11}\n\11edges {\n\11  node {\n\11    id\n\11  }\n\11}\n      }\n    }\n  }\n}" :variables nil :until nil :buffer #<killed buffer> :pages 1))
url-http-activate-callback()
url-http-chunked-encoding-after-change-function(1145 1273 128)
url-http-wait-for-headers-change-function(1 1298 1297)
url-http-generic-filter(#<process api.github.com> "HTTP/1.1 200 OK\15\nServer: GitHub.com\15\nDate: Tue, 05 Mar 2024 11:55:32 GMT\15\nContent-Type: application/json; charset=utf-8\15\nTransfer-Encoding: chunked\15\nX-OAuth-Scopes: notifications, read:org, repo, user\15\nX-Accepted-OAuth-Scopes: repo\15\nX-GitHub-Media-Type: github.v4; format=json\15\nX-RateLimit-Limit: 5000\15\nX-RateLimit-Remaining: 4881\15\nX-RateLimit-Reset: 1709640340\15\nX-RateLimit-Used: 119\15\nX-RateLimit-Resource: graphql\15\nAccess-Control-Expose-Headers: ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, X-GitHub-SSO, X-GitHub-Request-Id, Deprecation, Sunset\15\nAccess-Control-Allow-Origin: *\15\nStrict-Transport-Security: max-age=31536000; includeSubdomains; preload\15\nX-Frame-Options: deny\15\nX-Content-Type-Options: nosniff\15\nX-XSS-Protection: 0\15\nReferrer-Policy: origin-when-cross-origin, strict-origin-when-cross-origin\15\nContent-Security-Policy: default-src 'none'\15\nVary: Accept-Encoding, Accept, X-Requested-With\15\nContent-Encoding: gzip\15\nX-GitHub-Request-Id: C45C:27FC6F:1859A3B:1A1FB70:65E70833\15\n\15\n74\15\n\37\213\10\0\0\0\0\0\0\3\253VJ-*\312/*V\262\212\256V\312M-.NLOU\262R\nH,*NU\0K)\344\347)\304(i\304()h\370\48\6\271\372i*$\226(D\233X\32\352(\30\32\306*\351(\345\344''\226d\346\347A\f\311\311\314\3\232\0\222VJ\316\317)\315\315S\26224\254\215\5B\0+_=\357l\0\0\0\15\n0\15\n\15\n")
*gsexp-mencode* buffer

``` query { _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTY2OTQxNzg5Nw__: repository (name: "uqbar-issues",owner: "tlon-team") { issue (number: 209) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9LcjdrZ2c6OTY1MjAzMzA4Mg__: repository (name: "ea.news-issues",owner: "tlon-team") { issue (number: 7) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9KaERINmc6ODM1NDgwOTI1OA__: repository (name: "tlon-docs",owner: "tlon-team") { issue (number: 1) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTY1MDkyMTc4MA__: repository (name: "uqbar-issues",owner: "tlon-team") { issue (number: 206) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6OTYzNjg1MDU3OA__: repository (name: "uqbar-issues",owner: "tlon-team") { issue (number: 205) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9Kbl9LWWc6OTExNDAxNDM3Nw__: repository (name: "consult-gh",owner: "armindarvish") { issue (number: 102) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9LcmYxZGc6ODg2NDAwNjY4MQ__: repository (name: "uqbar-issues",owner: "tlon-team") { issue (number: 123) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9MT2JqNVE6OTM1MzAwNDk0Nw__: repository (name: "boletin",owner: "tlon-team") { issue (number: 1) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } _Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ__: repository (name: #("jinx" 0 4 (fontified t)),owner: #("minad" 0 5 (fontified t))) { issue (number: 140) { number id state stateReason isReadByViewer author { login } title createdAt updatedAt closedAt locked milestone { id } body assignees (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } comments (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id databaseId author { login } createdAt updatedAt body } } } labels (first: 100) { pageInfo { endCursor hasNextPage } edges { node { id } } } } } } ```

tarsius commented 7 months ago

We ended up with a propertized string in the query: ... repository (name: #("jinx" 0 4 (fontified t)) .... Now I just have to figure out where to remove that.

tarsius commented 7 months ago

gsexp-encode handles propertized strings just find, verified with:

(ghub-fetch-issue
 (propertize "magit" 'fontified t)
 (propertize "forge" 'fontified t)
 639 'ghub--graphql-pp-response)

(Check if that works for you too.)

I think the value stored in the database is doubly corrupted.

What does this return?

(oref (forge-get-repository '("github.com" "minad" "jinx") :tracked) name)

Should be (1) but I am guessing it is (3):

1: "jinx"                                           =>   "jinx"
2: (propertize "jinx" 'fontified t)                 =>   #("jinx" 0 4 (fontified t))
3: (format "%S" (propertize "jinx" 'fontified t))   =>   "#(\"jinx\" 0 4 (fontified t))"

Do you remember how long ago you added this repository to the database? If its a long time ago then this was probably due to a bug that has since been fixed. If it was recently, then I'll have to investigate how that can happen.

benthamite commented 7 months ago

Do you remember how long ago you added this repository to the database? If its a long time ago then this was probably due to a bug that has since been fixed. If it was recently, then I'll have to investigate how that can happen.

I'm almost certain I added it last week, when I reported this bug. It was also around that time that I started to experience this issue.

benthamite commented 7 months ago

What does this return?

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) nil)
  #<subr eieio-oref>(nil name)
  eieio-oref--closql-oref(#<subr eieio-oref> nil name)
  apply(eieio-oref--closql-oref #<subr eieio-oref> (nil name))
  eieio-oref(nil name)
  (progn (eieio-oref (forge-get-repository '("github.com" "minad" "jinx") :tracked) 'name))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)
tarsius commented 7 months ago

Try

(oref (forge-get-repository :id "Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ==") name)
tarsius commented 7 months ago

when I reported this bug

I very similar bug, but that must be a coincidence. :grinning:

benthamite commented 7 months ago

Still:

Debugger entered--Lisp error: (wrong-type-argument (or eieio-object cl-structure-object oclosure) nil)
  #<subr eieio-oref>(nil name)
  eieio-oref--closql-oref(#<subr eieio-oref> nil name)
  apply(eieio-oref--closql-oref #<subr eieio-oref> (nil name))
  eieio-oref(nil name)
  (progn (eieio-oref (forge-get-repository :id "Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc6OTYxOTQ5NzI4OQ==") 'name))
  elisp--eval-last-sexp(nil)
  eval-last-sexp(nil)
  funcall-interactively(eval-last-sexp nil)
  command-execute(eval-last-sexp)

If I go to the repo directory and invoke a Forge command, it says the repo has not been added. Obviously the repo was at one point added, and at least forge-pull-notifications still checks it.

Should I run forge-add-repository?

tarsius commented 7 months ago

If I ...

I'm having similar issues while debugging.

Should I run forge-add-repository?

Not yet.

I have to do other things now. Will be back later.

tarsius commented 7 months ago

Still:

I think that's the correct id:

(oref (forge-get-repository :id "Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc=") name)
benthamite commented 7 months ago

(oref (forge-get-repository :id "Z2l0aHViLmNvbTpSX2tnRE9KTjZNcnc=") name)

This returns #("jinx" 0 4 (fontified t)).

benthamite commented 7 months ago

I very similar bug, but that must be a coincidence. 😀

I wonder if they are in fact related. Did you see my latest comment?

tarsius commented 7 months ago

To remove the corrupted repositories use:

(pcase-dolist (`(,owner ,name ,id)
               (forge-sql [:select [owner name id] :from repository]))
  (when (text-properties-at 1 owner)
    (message "Removing %s/%s" owner name)
    (closql-delete (forge-get-repository :id id))))
benthamite commented 7 months ago

Cool—I confirm that the corrupted repositories were removed successfully.