Skip to content

Unable to start the app in Windows OS #170

Description

@athifongoqa

Good day, I'm trying to follow along with the Bolt for Python documentation on https://slack.dev/bolt-python/tutorial/getting-started. For some reason, it won't run. Please advise, thank you.

The slack_bolt version

slack-bolt==1.1.1
slack-sdk==3.1.0
slackclient==2.9.3

Python runtime version

Python 3.8.6

OS info

Microsoft Windows [Version 10.0.18363.1198]

Steps to reproduce:

(Based off steps given in the documentation)

  1. Create an app
  2. Tokens and installing apps
  3. Setting up your local project

Expected result:

For the app to let me know that it’s up and running.

Actual result:

image

Requirements

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

Activity

  1. seratch commented on Dec 5, 2020

    @seratch
    Contributor

    @athifongoqa hmm, it seems that you environment is failing to load ⚡️ in the app for some reason. We will update the code not to fail on any environment in future versions.

    A workaround I can suggest at this time is to use a Web framework along with Bolt. This means you do not use app.start() method to spin up your app.

    Here is a simple example using Flask. If you prefer others, you can find many examples here: https://github.com/slackapi/bolt-python/tree/v1.1.1/examples

    requirements.txt

    slack_bolt>=1.1.1,<1.2
    Flask>=1.1
    

    app.py

    from flask import Flask, request
    from slack_bolt import App
    from slack_bolt.adapter.flask import SlackRequestHandler
    
    app = App()
    
    @app.command("/hello")
    def hello(ack):
        ack("Hi!")
    
    flask_app = Flask(__name__)
    handler = SlackRequestHandler(app)
    
    @flask_app.route("/slack/events", methods=["POST"])
    def slack_events():
        return handler.handle(request)
    
    if __name__ == "__main__":
        # app.start(3000)
        flask_app.run(port=3000, debug=True)

    How to run

    pip install -r requirements.txt
    export SLACK_SIGNING_SECRET=***
    export SLACK_BOT_TOKEN=xoxb-***
    python app.py
  2. added
    bugSomething isn't working
    questionFurther information is requested
    on Dec 5, 2020
  3. added this to the 1.1.2 milestone on Dec 5, 2020
  4. athifongoqa commented on Dec 5, 2020

    @athifongoqa
    Author

    Two things:

    1. I am not all too familiar with what 'exporting' the signing secret and token actually means but I used set SIGNING_SECRET in the terminal bc apparently export is for Mac & Linux. Did I understand this correctly? If not, please advise further. Apologies if it is a silly question.
    2. I am now getting an error message with regards to not having an argument for App(), it seems.

    image

  5. seratch commented on Dec 5, 2020

    @seratch
    Contributor

    @athifongoqa

    1

    Yes, you can use set command for configuring env variables on Windows OS.

    2

    This is related to question 1. Once you set both SLACK_BOT_TOKEN and SLACK_SIGNING_SECRET in env variables, the app should successfully spin up.

  6. athifongoqa commented on Dec 6, 2020

    @athifongoqa
    Author

    So apparently export works better on Windows than set. Literally just changed that and all seems to be working fine now, thank you! I may be back soon for other issues in future haha! Keep well, Seratch!

  7. added a commit that references this issue on Dec 8, 2020
    256e47e
  8. christheodosius commented on Apr 26, 2021

    @christheodosius

    Hi, I'm also seeing this issue when trying to use this on Ubuntu 18.04, could we get the same fix for Linux?

  9. seratch commented on Apr 27, 2021

    @seratch
    Contributor

    @christheodosius Thanks for reporting this. We'll improve this at #309

  10. christheodosius commented on Apr 28, 2021

    @christheodosius

    @christheodosius Thanks for reporting this. We'll improve this at #309

    Fantastic, thank you so much!

  11. changed the title [-]Unable to start the app[/-] [+]Unable to start the app in Windows OS[/+] on Mar 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingquestionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions