Open Equirinya opened 6 months ago
Very similar to this reddit thread: https://www.reddit.com/r/Slack/comments/1btrarr/please_test_my_open_ai_slack_bot/
Hi, @Equirinya! I have just merged in some dependency updates in this PR for this template: https://github.com/slack-samples/deno-starter-template/pull/64, could you try to follow the quickstart guide again to create a new app and run it and see if you get the same errors?
I have exactly same error with @Equirinya.
@hello-ashleyintech I created a new app and run it but I got the same error:The start
script was not found (sdk_hook_not_found)
The slack.json file is present and looks like this:
{ "hooks": { "get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts" } }
Hi, @whogodemo!
How recently did you create this new app?
Unfortunately its the same error still @hello-ashleyintech
👋 This might be caused by the PowerShell version being used with CLI implementations of hook execution, but not the actual hook implementations. The exec: "pwsh": executable file not found
hints that the PowerShell version installed is less than 6.0
while support for pwsh
is added in 6.0
. Right now this is the minimum version supported by the CLI.
If you're using PowerShell could you check the version you're using? I'm wondering if this might be causing this issue and if bumping to a more recent version is possible?
Alo alo 😃
I want to confirm that I solved the problem updating to PowerShell 7
; you can't check your PS version running.
$PSVersionTable
If you want to install the latest version of PS
https://learn.microsoft.com/en-us/powershell/scripting/install/installing-powershell-on-windows?view=powershell-7.4#installing-the-msi-package
Stock control supervisors
I got the same issue on macOS, here are my slack doctor
outputs
✘ Runtime (foundations for the application)
Error: The `doctor` hook was not found (sdk_hook_not_found)
Suggestion: Ensure this hook is implemented in your `slack.json`
✘ Dependencies (requisites for development)
Error: The `check-update` hook was not found (sdk_hook_not_found)
Suggestion: Ensure this hook is implemented in your `slack.json`
There are few notes in the docs but I'm pretty sure my deno-slack-hooks
is v1.3.0
Because this is my slack.json
file
{
"hooks": {
"get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts"
}
}
Does anyone know how to solve this issue 😢
@tult98 The contents of slack.json
look good to me, but it might be possible that the deno
command isn't being found in you $PATH
🤔 Could you try running just the following command to see if it outputs JSON that starts with {"runtime": "deno", ...
?
$ deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts
I'd also be interested in the debug logs shown with a command like slack run -v
since the following should be shown early in the execution:
I'm hoping one of these point towards another issue or a fix, but please let me know if the responses seem unexpected!
Thanks for the quick response @zimeg
Here are the outputs from deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts
command. It might be the problem here 🤔
error: Import 'https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts' failed: client error (Connect)
And the outputs from slack run -v
[2024-07-28 07:26:44] FlushToLogstash will POST https://slackb.com/events/cli payload: [{"context":{"bin":"slack","cli_version":"2.28.0","command":"run","command_canonical":"platform run","flags":["verbose"],"host":"54f03ef1feb4a887ed15e32389ea80c14e5599d4","os":"darwin","project_id":"b3aa1650-e53c-4a54-9957-9f6a66834a41","runtime":"Deno","runtime_version":"v1.45.4","session_id":"2a5b5c6b-c2ea-4803-ac95-79e1505ac7b0","system_id":"526c18bb-67b9-4127-bde5-474839e44665"},"data":{"app":{},"auth":{"user_id":"U07EQ55Q9H7"},"error_code":"sdk_hook_not_found","error_msg":"The `start` script was not found (sdk_hook_not_found)\n\n💡 Suggestion\n Hook scripts are defined in the Slack configuration file ('slack.json').\n Every app requires a 'slack.json' file and you can find a working example at:\n https://github.com/slack-samples/deno-starter-template/blob/main/slack.json\n"},"event":"error","timestamp":1722126404044}]
[2024-07-28 07:26:44] FlushToLogstash response status code: 200, body: ok
@tult98 Interesting 👀 This might be VPN or network settings blocking a connection to https://deno.land 🦕
Wanting to rule a few things out- are you connected through a VPN? And does the following command on the same machine work for you?
$ deno run https://deno.land/x/cowsay@1.1/cowsay.ts -t="greetings"
ah yes, I did use a VPN, it might be the problem. Let me turn off the VPN and try again. Thanks for your support 🙏
are you connected through a VPN
No, it doesn't
does the following command on the same machine work for you?
hey guys, I got the same problem now.... I'm pretty sure my PowerShell is the newest version(7.4.4).
Here is the problem:
The `start` script was not found (sdk_hook_not_found)
Here is my Slack doctor result:
✘ Runtime (foundations for the application)
Error: The `doctor` hook was not found (sdk_hook_not_found)
✘ Dependencies (requisites for development)
Error: The `check-update` hook was not found (sdk_hook_not_found)
And my slack.json code:
{
"hooks": {
"get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.1/mod.ts"
}
}
Did anyone solve this problem already? Thank you!!
@as43647 👋 Hi! Which version of the CLI is this happening with? My first guess is that the deno
command is not being found but this might be related to how PowerShell and the CLI communicate when the hooks are called 🤔
Hi @zimeg !! My version is slack.exe v2.29.1
yeah I run the deno command and it starts with {"runtime": "deno", ...
I also run slack run -v
and it shows:
[2024-08-16 18:07:01] Resolving logstash host, https://slack.com, 2.29.1 [2024-08-16 18:07:01] system_id: fb7a886f-a7d2-404f-850a-972acdd6013d [2024-08-16 18:07:01] project_id: 30812829-09b0-4be6-abf2-2e08bf9a2050 [2024-08-16 18:07:01] active flag experiments: [] [2024-08-16 18:07:01] active project experiments: [] [2024-08-16 18:07:01] active system experiments: [] [2024-08-16 18:07:01] reading credentials file [2024-08-16 18:07:01] found authorizations at C:\Users\as436\.slack\credentials.json reading [2024-08-16 18:07:02] failed to initialize slack.json configurations: invalid character '.' looking for beginning of value [2024-08-16 18:07:02] initialize runtime from auto-detect: Deno (v1.45.5) [2024-08-16 18:07:02] reading credentials file [2024-08-16 18:07:02] found authorizations at C:\Users\as436\.slack\credentials.json reading ? Choose a local environment Install to a new team ? Install to a new team w1722928218-tjj244093 T07FNGSBC59 > If you leave this team, you can no longer manage the installed apps Installed apps will belong to the team if you leave the workspace [2024-08-16 18:07:05] HTTP Request: POST https://slack.com/api/auth.test HTTP/1.1 HTTP Request Body: token=... [2024-08-16 18:07:05] HTTP Response Status: HTTP/1.1 200 OK HTTP Response Body: {"ok":true,"url":"https:\/\/w1722928218-tjj244093.slack.com\/","team":"\u65b0\u7684\u5de5\u4f5c\u7a7a\u9593","user":"...","team_id":"T07FNGSBC59","user_id":"U07FR4T1KRS","expires_in":22039,"is_enterprise_install":false} [2024-08-16 18:07:05] reading credentials file [2024-08-16 18:07:05] found authorizations at C:\Users\as436\.slack\credentials.json reading [2024-08-16 18:07:05] Resolving logstash host, https://slack.com, 2.29.1 [2024-08-16 18:07:05] HTTP Request: POST https://slack.com/api/auth.test HTTP/1.1 HTTP Request Body: token=... [2024-08-16 18:07:06] HTTP Response Status: HTTP/1.1 200 OK HTTP Response Body: {"ok":true,"url":"https:\/\/w1722928218-tjj244093.slack.com\/","team":"\u65b0\u7684\u5de5\u4f5c\u7a7a\u9593","user":"...","team_id":"T07FNGSBC59","user_id":"U07FR4T1KRS","expires_in":22039,"is_enterprise_install":false} [2024-08-16 18:07:06] Starting root command cleanup routine Check C:\Users\as436\.slack\logs\slack-debug-20240816.log for error logs The `start` script was not found (sdk_hook_not_found) > Suggestion Hook scripts are defined in the Slack configuration file ('slack.json'). Every app requires a 'slack.json' file and you can find a working example at: https://github.com/slack-samples/deno-starter-template/blob/main/slack.json [2024-08-16 18:07:06] FlushToLogstash will POST https://slackb.com/events/cli payload: [{"context":{"bin":"...\\AppData\\Local\\slack-cli\\bin\\slack.exe","cli_version":"2.29.1","command":"run","command_canonical":"platform run","flags":["verbose"],"host":"978c8bba38c9a4f024a5cb28d420fb807d34b89f","os":"windows","project_id":"30812829-09b0-4be6-abf2-2e08bf9a2050","runtime":"Deno","runtime_version":"v1.45.5","session_id":"062d2a88-e0b7-4269-8086-3e7a208fdf21","system_id":"fb7a886f-a7d2-404f-850a-972acdd6013d"},"data":{"app":{},"auth":{"user_id":"U07FR4T1KRS"},"error_code":"sdk_hook_not_found","error_msg":"The `start` script was not found (sdk_hook_not_found)\n\n\u003e Suggestion\n Hook scripts are defined in the Slack configuration file ('slack.json').\n Every app requires a 'slack.json' file and you can find a working example at:\n https://github.com/slack-samples/deno-starter-template/blob/main/slack.json\n"},"event":"error","timestamp":1723802826124}] [2024-08-16 18:07:06] FlushToLogstash response status code: 200, body: ok
FYI I'm using Windows. Thank you!!
@as43647 🤔 Hmm... For pedantics does the deno run
response match the following and parse as valid JSON?
Asking because this line is a bit suspicious with the invalid .
character!
[2024-08-16 18:07:02] failed to initialize slack.json configurations: invalid character '.' looking for beginning of value
This might also be caused by the environment you're running slack
and deno
in. It's possible that a debugger or similar program is adding additional output to the deno
command and causing unexpected parsings with the CLI 🤔
If the output above matches and these commands are run with the same path and shell, I'll be a bit stumped but we'll of course continue investigations! :mag:
Hey @zimeg ~
My Deno version is:
deno 1.45.5 (release, x86_64-pc-windows-msvc)
v8 12.7.224.13
typescript 5.5.2
There are some different between two json file deno_slack_hooks
and deno_slack_runtime
. Both are different version. Should I upgrade them? (my version are 1.3.0 and 1.1.1 btw)
Thank u!!
@as43647 👀 All of those versions seem alright to me! It is notable that Windows is being used, but I don't believe that should be causing a problem...
Can you share the outputs from these commands when running in a project directory?
$ deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts
$ deno run -q --config=deno.jsonc --allow-read --allow-net --allow-env https://deno.land/x/deno_slack_hooks@1.3.0/get_manifest.ts
$ slack manifest
I'm hoping to figure out if this is caused by deno
or how the CLI is interpreting the "hook" responses 🤔
Hi @zimeg
Here is my output:
deno run -q --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/mod.ts
{"runtime":"deno","hooks":{"get-manifest":"deno run -q --config=deno.jsonc --allow-read --allow-net --allow-env https://deno.land/x/deno_slack_hooks@1.3.0/get_manifest.ts","get-trigger":"deno run -q --config=deno.jsonc --allow-read --allow-net --allow-env https://deno.land/x/deno_slack_hooks@1.3.0/get_trigger.ts","build":"deno run -q --config=deno.jsonc --allow-read --allow-write --allow-net --allow-run --allow-env https://deno.land/x/deno_slack_hooks@1.3.0/build.ts","start":"deno run -q --config=deno.jsonc --allow-read --allow-net --allow-run --allow-env https://deno.land/x/deno_slack_runtime@1.1.1/local-run.ts ","check-update":"deno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/check_update.ts","install-update":"deno run -q --config=deno.jsonc --allow-run --allow-read --allow-write --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/install_update.ts","doctor":"deno run -q --config=deno.jsonc --allow-read --allow-net https://deno.land/x/deno_slack_hooks@1.3.0/doctor.ts"},"config":{"protocol-version":["message-boundaries"],"watch":{"filter-regex":"\\.(ts|js)$","paths":["."]}}}
deno run -q --config=deno.jsonc --allow-read --allow-net --allow-env
https://deno.land/x/deno_slack_hooks@1.3.0/get_manifest.ts` {"_metadata":{"major_version":2},"display_information":{"name":"hello-world-app","description":"A blank template for building Slack apps with Deno"},"icon":"assets/default_new_app_icon.png","oauth_config":{"scopes":{"bot":["commands","chat:write","chat:write.public"]},"token_management_enabled":false},"features":{"bot_user":{"display_name":"hello-world-app"},"app_home":{"messages_tab_enabled":true,"messages_tab_read_only_enabled":true}},"settings":{"function_runtime":"slack","org_deploy_enabled":true},"functions":{},"workflows":{},"outgoing_domains":[]}
slack manifest
Check C:\Users\as436\.slack\logs\slack-debug-20240822.log for error logs The `manifest` script was not found (sdk_hook_not_found) > Suggestion Hook scripts are defined in the Slack configuration file ('slack.json'). Every app requires a 'slack.json' file and you can find a working example at: https://github.com/slack-samples/deno-starter-template/blob/main/slack.json
Thank you!
I've followed the Quick-Start https://api.slack.com/automation/quickstart and but no matter which template I'm cloning i always get this error: The
start
script was not found (sdk_hook_not_found).:This is the slack doctor:
The slack.json file is present and looks like this:
Im executing the slack run command in the right folder I've upgraded the slack cli to the latest version the slack.json file is identical to the one of this slack-sample
These are the logs: