brianpetro / smart-connect

66 stars 7 forks source link

Smart Connect fails to create note #38

Open rtm opened 1 week ago

rtm commented 1 week ago

It shows me in the console:

[2024-09-10T01:15:45.302Z] - POST /create-note - 20.161.76.51
VM37 node:async_hooks:206 group_dir_route_key post:/default/create-note
VM37 node:async_hooks:206 Handling POST /create-note {
  "note_path": "Zettelkasten/Fleeting Notes/2024-09-09-Methylmalonic Acid.md",
  "note_content": "# Methylmalonic Acid\n\nMethylmalonic acid (MMA) is a substance produced in small amounts during the metabolism of fatty acids and certain amino acids. Elevated levels of MMA in the blood or urine can be indicative of vitamin B12 deficiency or other metabolic disorders.\n\n- My reading on 2024-09-05 was 0.16.\n\n## References\n1. [MedlinePlus - MMA test](https://medlineplus.gov/lab-tests/methylmalonic-acid-mma-test/)\n2. [Mayo Clinic - MMA test](https://www.mayoclinic.org/tests-procedures/methylmalonic-acid/about/pac-20384914)\n\nTags: #medical-test",
  "method": "POST",
  "path": "/create-note",
  "headers": {
    "x-real-ip": "20.161.76.51",
    "x-forwarded-for": "20.161.76.51",
    "host": "801f24e1e176c736b445dba84223e6aa.connect.smartconnections.app",
    "x-forwarded-proto": "https",
    "x-nginx-proxy": "true",
    "connection": "close",
    "content-length": "652",
    "x-openai-internal-caller": "plugin-service",
    "user-agent": "Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko); compatible; ChatGPT-User/1.0; +https://openai.com/bot",
    "openai-ephemeral-user-id": "a48cece3-0dd6-5fcf-9d65-1fb102276941",
    "openai-conversation-id": "38c14562-ffec-5a0f-af01-2e8ef64feb13",
    "openai-gpt-id": "g-A6uN0Batq",
    "authorization": "Bearer default",
    "content-type": "application/json",
    "x-datadog-trace-id": "7992431124327454395",
    "x-datadog-parent-id": "17571584104411862089",
    "x-datadog-sampling-priority": "0",
    "x-datadog-tags": "_dd.p.dm=-1,_dd.p.tid=66df9db900000000",
    "traceparent": "00-167f983a684284325f431849bd6f5dd0-3e1e9854024c9536-00",
    "tracestate": "dd=p:d11ec39eb0d65d3e;s:0;t.dm:-1;t.tid:66df9db900000000",
    "x-openai-traffic-source": "user",
    "x-openai-originator-env": "prod",
    "accept": "*/*",
    "accept-encoding": "gzip, deflate, br"
  }
}
VM34 task_queues:95 SmartActions Error: TypeError: Cannot read properties of undefined (reading 'fs')
    at ScActionGroup.pre_process (_sc.mjs:62477:28)
    at ScActionGroup.handler (_sc.mjs:62436:25)
    at ScActionGroup.route_handler (_sc.mjs:62422:31)
    at ScActions.handle_routes (_sc.mjs:62113:34)
    at Layer.handle [as handle_request] (_sc.mjs:22124:9)
    at next (_sc.mjs:22293:17)
    at ScActions.action_middleware (_sc.mjs:62159:5)
    at Layer.handle [as handle_request] (_sc.mjs:22124:9)
    at next (_sc.mjs:22293:17)
    at _sc.mjs:9291:9
handle_routes @ _sc.mjs:62116
processTicksAndRejections @ VM34 task_queues:95
await in processTicksAndRejections (async)
handle @ _sc.mjs:22124
next @ _sc.mjs:22293
action_middleware @ _sc.mjs:62159
handle @ _sc.mjs:22124
next @ _sc.mjs:22293
(anonymous) @ _sc.mjs:9291
runInAsyncScope @ VM37 node:async_hooks:206
invokeCallback @ _sc.mjs:5594
done @ _sc.mjs:5587
onEnd @ _sc.mjs:5638
emit @ VM21 node:events:519
endReadableNT @ VM95 readable:1696
processTicksAndRejections @ VM34 task_queues:82
Show 10 more frames
Show less

Any ideas?

brianpetro commented 6 days ago

Hi @rtm and thanks for trying Smart Connect 😊

This error happens when the environment isn't selected for the GPT (Action Group).

Make sure the Environment is set for the specific GPT you are using, and this should resolve itself.

image

🌴

rtm commented 6 days ago

Thanks. Is this something that changed, or can just get unset somehow, because it was working fine and then just stopped working, or was it maybe due to updating the software?

On Wed, Sep 11, 2024, 08:26 WFH Brian @.***> wrote:

Hi @rtm https://github.com/rtm and thanks for trying Smart Connect 😊

This error happens when the environment isn't selected for the GPT (Action Group).

Make sure the Environment is set for the specific GPT you are using, and this should resolve itself.

image.png (view on web) https://github.com/user-attachments/assets/e74982f5-67e5-4107-8940-9ec5661970fe

🌴

— Reply to this email directly, view it on GitHub https://github.com/brianpetro/smart-connect/issues/38#issuecomment-2343989774, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAF6R5NXV5SO7AYMHCX3V3ZWBOJPAVCNFSM6AAAAABN5VIGYSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNBTHE4DSNZXGQ . You are receiving this because you were mentioned.Message ID: @.***>

rtm commented 4 days ago

No joy. How do I debug this? ChatGPT says it's seeing an "Internal Server Error".

Also, when I do "Run Tests for Notes", it gives me a bunch of errors.

Do I need to set up the Custom Actions in the GPT again? To do that, it says I need to get the "OpenAI API Key" from "Smart Connect", but I can't see where to get that from.

A long time when I first set this up I needed some magic key and had to input it somewhere, but now I can't see where that is either.

brianpetro commented 4 days ago

@rtm make sure that environment setting is set for all the action groups. The "profiles" from the earlier versions were converted to these groups (lots of good reasons for this, like using multiple custom GPTs at the same time). One of these lines up with your custom GPT.

If that doesn't fix it, screenshots of the errors in the console log, particularly right after the "Internal server error", would help me see what's going 🌴