Closed tar-xzvff closed 6 days ago
@tar-xzvff Greetings! I'm here to assist you with any bugs, questions, or contributions while you await a human maintainer. Let's work together to resolve this issue.
The "Internal Server Error" you're encountering when trying to integrate GitHub in Dify version 0.7.1 using Docker is due to an issue with the vars()
function in the oauth.py
controller. The error message indicates that the vars()
function is being called on an object that does not have a __dict__
attribute.
To resolve this issue, you need to modify the get
method in the OAuthLogin
class to avoid using vars()
on an object that doesn't support it. Here's the corrected implementation:
class OAuthLogin(Resource):
def get(self, provider: str):
OAUTH_PROVIDERS = get_oauth_providers()
with current_app.app_context():
oauth_provider = OAUTH_PROVIDERS.get(provider)
if oauth_provider:
print(oauth_provider.__dict__)
if not oauth_provider:
return {'error': 'Invalid provider'}, 400
auth_url = oauth_provider.get_authorization_url()
return redirect(auth_url)
Replace the print(vars(oauth_provider))
line with print(oauth_provider.__dict__)
to correctly access the attributes of the oauth_provider
object.
Additionally, ensure that the Ollama service is accessible from the Docker container by replacing localhost
with host.docker.internal
in the service URL:
http://host.docker.internal:11434
Update your Docker configuration accordingly:
# Example configuration in docker-compose.yaml
services:
api:
environment:
- SERVICE_API_URL=http://host.docker.internal:11434
This should resolve the connection issue and make the service accessible from the Docker container [1][2].
To continue talking to Dosu, mention @dosu.
from what I understand
it seems they are finally working on it and that issue is old. here you have the solution; but since it is not in english they ignored it in any case you could identify the variables here
in your Google Cloud Platform
you must create an OAuth which Authorized redirect URIs
an URL like this: https://_mydify.mydomain.com_/console/api/oauth/authorize/google
after that you will received your GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET which you will add into your .env
### Google
- GOOGLE_CLIENT_ID="Google Client ID"
- GOOGLE_CLIENT_SECRET="Google Client Secret"
remark: the "" are not mandatory
since you only change .env and not docker-compose.yml it is preferable to do down and up.
docker compose down
docker compose up -d
you do understand that it is to authenticate user via Google service and not to access your files in your Google Drive right ?
Self Checks
Dify version
0.7.1
Cloud or Self Hosted
Self Hosted (Docker)
Steps to reproduce
After launching Dify, create an administrator account and log in.
Settings -> ACCOUNT -> Integrations Click Connect.![スクリーンショット 2024-08-23 0 56 03](https://github.com/user-attachments/assets/f0dbb80b-ae9f-4b57-91af-0cdfb90e6ffb)
It jumps to http:///console/api/oauth/login/github, but an Internal Server Error is displayed.
http:///console/api/oauth/login/github
{"message": "Internal Server Error", "code": "unknown"}
The logs are as follows.
✔️ Expected Behavior
Github integration is available.
❌ Actual Behavior
Github integration is not available.