Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deno Permission Denied Error When Writing to File via Slack Input Form #350

Open
InesKouki opened this issue Aug 5, 2024 · 2 comments
Open
Assignees
Labels
question Further information is requested

Comments

@InesKouki
Copy link

Hello ! I am working on a Slack-Deno application. My project involves a function that handles documentation onboarding. This function reads the input from a Slack form, writes to a CSV file, and also triggers a PowerShell script. However, I am encountering a PermissionDenied error when trying to write to the CSV file.

Screenshot 2024-08-05 at 14 31 25
Could someone help me with this please ?
Screenshot 2024-08-05 at 13 44 00

This is my manifest file

export default Manifest({
  name: "client-onboarding-app",
  description: "A Slack app to onboard clients",
  icon: "assets/default_new_app_icon.png",
  workflows: [OnboardingWorkflow],
  functions: [HandleDocumentationOnboardingDefinition],
  outgoingDomains: [],
  botScopes: ["commands", "chat:write", "chat:write.public", "files:write"],
});

And this is my slack.json

{
  "hooks": {
    "get-hooks": "deno run -q --allow-read --allow-net https://deno.land/x/[email protected]/mod.ts"
  }
}
@hello-ashleyintech hello-ashleyintech self-assigned this Aug 5, 2024
@hello-ashleyintech
Copy link

hello-ashleyintech commented Aug 5, 2024

Hi, @InesKouki! Thanks for submitting your question 😄

Based on the PermissionDenied error, it seems like write permissions haven't been granted to the system for your CSV file. I would recommend adding the --allow-write flag within your slack.json - you can reference the deno-slack-hooks repo here for more info!

@hello-ashleyintech hello-ashleyintech added the question Further information is requested label Aug 5, 2024
@hello-ashleyintech
Copy link

@InesKouki I also just received word from the team that the --allow-write flag will only work for slack run, but if you slack deploy your app to Slack infra, that will not support file writing and will fail with the same error!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants