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

Authentication Issue - Logging into Cal.com selfhosted #328

Open
SecureCPU opened this issue Feb 13, 2024 · 11 comments
Open

Authentication Issue - Logging into Cal.com selfhosted #328

SecureCPU opened this issue Feb 13, 2024 · 11 comments

Comments

@SecureCPU
Copy link

Hey, I keep getting the following error everytime I try to login.
I updated just today, and started getting this error.

@calcom/web:start: [next-auth][error][CLIENT_FETCH_ERROR]
@calcom/web:start: https://next-auth.js.org/errors#client_fetch_error fetch failed {
@calcom/web:start: error: {
@calcom/web:start: message: 'fetch failed',
@calcom/web:start: stack: 'TypeError: fetch failed\n' +
@calcom/web:start: ' at Object.fetch (node:internal/deps/undici/undici:11730:11)\n' +
@calcom/web:start: ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)',
@calcom/web:start: name: 'TypeError'
@calcom/web:start: },
@calcom/web:start: url: 'https://meetly.cc/api/auth/csrf',
@calcom/web:start: message: 'fetch failed'
@calcom/web:start: }

@voska
Copy link

voska commented Feb 29, 2024

Sounds like you need to set the NEXTAUTH_URL https://github.com/calcom/docker?tab=readme-ov-file#client_fetch_error

@voska
Copy link

voska commented Mar 2, 2024

@keithwillcode I think there is a cleaner solution here.

In the docker-compose.yaml file

calcom:
  image: calcom.docker.scarf.sh/calcom/cal.com
  ....
  networks:
    stack:
      aliases:
        - "example.com"

this eliminates the need for NEXTAUTH_URL for self-hosted docker-compose users and doesn't have the login/logout bugs

@keithwillcode
Copy link
Contributor

@keithwillcode I think there is a cleaner solution here.

In the docker-compose.yaml file

calcom:
  image: calcom.docker.scarf.sh/calcom/cal.com
  ....
  networks:
    stack:
      aliases:
        - "example.com"

this eliminates the need for NEXTAUTH_URL for self-hosted docker-compose users and doesn't have the login/logout bugs

Ok great. Thanks for the suggestion

@keithwillcode keithwillcode reopened this Mar 2, 2024
@xcellentavi
Copy link

Yes, I still cannot resolve the client fetch errors on unRaid using the latest container. If I use http://serverip:PORT/api/auth as the NEXTAUTH_URL variable, then I am unable to login as it gets stuck at 2FA and will not proceed. If I keep it as https://my.domain.com/api/auth, no issues logging in. However, the client fetch errors will appear in the logs. This used to be causing ECONNREFUSED errors before being fixed here: calcom/cal.com#11911

Please let me know if there are steps to take now or if we need to wait for the docker containers to address the solution in a future release.

@voska
Copy link

voska commented Mar 4, 2024

@xcellentavi try modifying the docker-compose.yaml file, lines 38, 39:

    networks:
      - stack

change to:

  networks:
    stack:
      aliases:
        - "my.domain.com"

^ Note, this is "my.domain.com" without https://.

Then set the NEXTAUTH_URL var to https://my.domain.com/api/auth

This worked for my Synology setup.

@xcellentavi
Copy link

@voska thank you, but I don't use portainer or docker compose on unraid. I use community apps and will wait until this fix is pushed to a future release. Glad it is working for you and hope I can finally be rid of the client fetch errors soon!

@voska
Copy link

voska commented Mar 4, 2024

@xcellentavi can you point me to the Unraid app page/repo for this? I took a quick look here, but couldn't find it.

Does Unraid let you specify custom environment vars for an app?

@xcellentavi
Copy link

@xcellentavi can you point me to the Unraid app page/repo for this? I took a quick look here, but couldn't find it.

Does Unraid let you specify custom environment vars for an app?

Yeah, it was removed due to missing project and support tags, but I had installed it before it was taken down: https://github.com/ibracorp/unraid-templates/tree/master/cal.com

I have been tweaking and updating the variables along the way, but a few of us discuss the issues in the unraid forum here: https://forums.unraid.net/topic/133848-request-calcom-formerly-calendso/

The docker container template section lets you customize the paths, ports and variables.

@xcellentavi
Copy link

@voska I didn't tag you in the last comment, but let me know if you need any additional information or if you think there is someone else I should contact to get calcom added back to community apps. Thank you!

@voska
Copy link

voska commented Apr 9, 2024

@xcellentavi I'm not sure I can get it added back to the community app store (especially since I can't test it - I don't have an Unraid) but can you use/manually import a custom XML file like this one?
https://github.com/ibracorp/unraid-templates/tree/master/cal.com

If so, I think we can get this working, but I'll need your help to test things out.

@xcellentavi
Copy link

@voska I am running mine on unraid no problem, but new users can't because it requires manual setup since it isn't appearing in community apps. One user was able to post instructions on manually adding the XML here: https://forums.unraid.net/topic/133848-request-calcom-formerly-calendso/#comment-1366375

It is missing some of the newer env variables, but again the goal would be to have it included in CA so anyone can load the container on their servers. No worries if this can't be done right now, and I'll keep try to bug ibracorp to update their template if possible.

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

No branches or pull requests

4 participants