Skip to content

Slack bolt installation to workspace fails if workspace name is in Japanese #974

Description

@joseph-scu

Hello,

I am trying to install my Slack Bolt app to a certain workspace that contains a Japanese workspace as its name (for testing purposes I used 撮影課). I am using OAuth for authentication. When I attempt to install the app I get a 502 Bad Gateway Error. There doesn't seem to be any errors in the logs, however I noticed if I tried to use the app in Slack I do see an error (see below).

My code for hanlding OAUth is as below (I believe its taken mostly from the docs)

load_dotenv()

try:
    with engine.connect() as conn:
        conn.execute("select count(*) from slack_bots")
except Exception as e:
    installation_store.metadata.create_all(engine)
    oauth_state_store.metadata.create_all(engine)

oauth_settings = OAuthSettings(
    client_id=os.environ.get("SLACK_CLIENT_ID"),
    client_secret=os.environ.get("SLACK_CLIENT_SECRET"),
    scopes=["channels:history", "channels:join", "channels:read",
            "chat:write", "commands", "groups:history", "im:history", "users:read"],
    installation_store=installation_store,
    state_store=oauth_state_store,
    install_page_rendering_enabled=False
)

app = App(
    signing_secret=os.environ.get("SLACK_SIGNING_SECRET"),
    oauth_settings=oauth_settings
)

Reproducible in:

As below

The slack_bolt version

alembic==1.9.2
apt-xapian-index==0.49
attrs==22.2.0
autopep8==2.0.1
awscli==2.9.19
awscrt==1.0.0.dev0
catfish==4.16.4
certifi==2022.12.7
chardet==5.1.0
charset-normalizer==3.0.1
colorama==0.4.6
cryptography==38.0.4
cupshelpers==1.0
dbus-python==1.3.2
deprecation==2.0.7
distro==1.8.0
docutils==0.19
dtrx==8.4.0
gattlib==0.20210616
greenlet==2.0.1
gyp==0.1
idna==3.3
iniconfig==1.1.1
jmespath==1.0.1
lightdm-gtk-greeter-settings==1.2.2
lxml==4.9.2
Mako==1.2.4
MarkupSafe==2.1.2
more-itertools==8.10.0
mugshot==0.4.3
mypy==0.991
mypy-extensions==0.4.3
notify2==0.3
ntpsec==1.2.2
onboard==1.4.1
packaging==23.0
pdfarranger==1.9.2
pexpect==4.8.0
pikepdf==6.0.0+dfsg
Pillow==9.4.0
pluggy==1.0.0+repack
prompt-toolkit==3.0.38
ptyprocess==0.7.0
py==1.11.0
pyasn1==0.4.8
PyBluez==0.23
pycairo==1.20.1
pycodestyle==2.10.0
pycups==2.0.1
PyGObject==3.42.2
pysmbc==1.0.23
pytest==7.2.1
python-apt==2.6.0
python-dateutil==2.8.2
python-debian==0.1.49
pyxdg==0.28
PyYAML==6.0
requests==2.28.2
roman==3.3
rpl==1.14
ruamel.yaml==0.17.21
ruamel.yaml.clib==0.2.7
six==1.16.0
SQLAlchemy==2.0.0
systemd-python==235
typing_extensions==4.4.0
ufw==0.36.2
urllib3==1.26.12
wcwidth==0.2.5
xdg==5

Python runtime version

Python 3.11.4

OS info

#1 SMP PREEMPT_DYNAMIC Debian 6.0.10-2 (2022-12-01)

Steps to reproduce:

(Share the commands to run, source code, and project settings (e.g., setup.py))

  1. Have a workspace with Japanese characters.
  2. Ensure you are using OAuth for authentication
  3. Attempt to install the application (via /slack/install)
  4. Notice that you will get a 502 Bad Gateway Error. The app will be visible in your list of apps however, but it won't be accessible

Expected result:

App installs to workspace

Actual result:

Application installs to the workspace, but not successfully. There is a 502 Bad Gateway Error, but the app is visible in workspaces list of apps. If you try to navigate to it you may see the following error in the logs:

return codecs.charmap_encode(input,errors,encoding_table)
| UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-2: character maps to <undefined>

Activity

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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions