-
Notifications
You must be signed in to change notification settings - Fork 981
Description
I have created a GitHub Copilot Client using Python SDK (github-copilot-sdk 0.1.32). It works perfectly from my local environment (Windows 11).
Same setup and script I try to run from docker container using debian bookworm-slim but it fails.
Details:
GitHub CLI: 2.23.0
GitHub Copilot CLI: 1.0.5
GitHub Copilot SDK: 0.1.32
Trying to use Copilot SDK Authentication using Environment variable as explained at here.
Have generated PAT token from my account and set to COPILOT_GITHUB_TOKEN, GH_TOKEN and/or GITHUB_TOKEN (already tried with single variable and by setting all, I have also ensured all required setup completed i.e. Copilot CLI, Copilot SDK etc. and when try to print environment variable from python script, values are coming correctly). I have also verified network connectivity from container, it is working.
The same environment variable COPILOT_GITHUB_TOKEN & token, set on windows machine then same python script which connects to GitHub Copilot able to get response. So it seems issue is only available for Linux debian only.
See the build result:
STEP 1/12: FROM python:3.12-slim-bookworm
STEP 2/12: RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates nodejs npm gh && rm -rf /var/lib/apt/lists/* && npm install -g @github/copilot
--> Using cache a4ccaa46032d3642441e6e2b094ac3c7d4e0cf64e32fb6e72c5d85c784638683
--> a4ccaa46032d
STEP 3/12: COPY requirements.txt /tmp/requirements.txt
--> Using cache 1f0b6b01671db8da958182a5303cb5fbd44e78649c85f15529ff96481747233d
--> 1f0b6b01671d
STEP 4/12: RUN pip install --no-cache-dir -r /tmp/requirements.txt && rm /tmp/requirements.txt
--> Using cache 1aa777c41edc5eadd3687b58f97fa31cc660dda2cf8b95cae564fe9d7390ae91
--> 1aa777c41edc
STEP 5/12: WORKDIR /app
--> Using cache eed02166f19104cb2aff5b8023045ba8265bfd2f4a68a28b97dcc50b9a8088c1
--> eed02166f191
STEP 6/12: COPY my_copilot.py .
--> 763f86e05850
STEP 7/12: RUN npm --version
9.2.0
--> 9c7158da1591
STEP 8/12: RUN gh --version
gh version 2.23.0 (2023-02-27 Debian 2.23.0+dfsg1-1)
https://github.com/cli/cli/releases/tag/v2.23.0
--> 3c732852e6db
STEP 9/12: RUN python --version
Python 3.12.13
--> 44f669e40aba
STEP 10/12: RUN copilot --version
GitHub Copilot CLI 1.0.5.
Run 'copilot update' to check for updates.
--> 4faf50568069
STEP 11/12: ENV COPILOT_GITHUB_TOKEN GH_TOKEN GITHUB_TOKEN
--> ad6863399eea
STEP 12/12: ENTRYPOINT ["python", "my_copilot.py"]
COMMIT mr-copilot-review
--> 6e78da891e58
Successfully tagged
When run container it fails with PermissionError: GitHub Copilot authentication failed: Not authenticated.
Can you please help me fixing this issue.