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

Baïkal CalDAV Calendar only working one way. #8684

Closed
hotspot-app opened this issue May 5, 2023 · 14 comments · Fixed by #9493
Closed

Baïkal CalDAV Calendar only working one way. #8684

hotspot-app opened this issue May 5, 2023 · 14 comments · Fixed by #9493
Labels
1 points Created by SyncLinear.com 🐛 bug Something isn't working Low priority Created by Linear-GitHub Sync

Comments

@hotspot-app
Copy link

Found a bug? Please fill out the sections below. 👍

Issue Summary

In my self-hosted version of cal.com i am using a Baïkal CalDAV calendar. New bookings are written to this calendar. But it seems as cal.com does not receive any existing appointments from the calendar.

Steps to Reproduce

Connect a Baïkal (https://sabre.io/baikal/) CalDAV calendar to cal.com

Technical details

I am using the version of May 4, 2023.

The node version is v16.19.1

I get this output:

@calcom/web:start: TypeError: Cannot read properties of undefined (reading 'data')
@calcom/web:start:     at /root/cal.com/apps/web/.next/server/chunks/1012.js:273:24
@calcom/web:start:     at Array.forEach (<anonymous>)
@calcom/web:start:     at CalDavCalendarService.getAvailability (/root/cal.com/apps/web/.next/server/chunks/1012.js:272:17)
@calcom/web:start:     at processTicksAndRejections (node:internal/process/task_queues:96:5)
@calcom/web:start:     at async /root/cal.com/apps/web/.next/server/chunks/39906.js:191:32
@calcom/web:start:     at async Promise.all (index 0)
@calcom/web:start:     at async getCachedResults (/root/cal.com/apps/web/.next/server/chunks/39906.js:199:28)
@calcom/web:start:     at async getStaticProps (/root/cal.com/apps/web/.next/server/pages/[user]/calendar-cache/[month].js:56:60)
@calcom/web:start:     at async Object.renderToHTML (/root/cal.com/node_modules/next/dist/server/render.js:386:20)
@calcom/web:start:     at async doRender (/root/cal.com/node_modules/next/dist/server/base-server.js:809:34)
@calcom/web:start:     at async cacheEntry1.responseCache.get.incrementalCache.incrementalCache (/root/cal.com/node_modules/next/dist/server/base-server.js:929:28)
@calcom/web:start:     at async /root/cal.com/node_modules/next/dist/server/response-cache/index.js:83:36 Cannot read properties of undefined (reading 'data')
@calcom/web:start: Error setting header x-csp=not-opted-in for /sales/calendar-cache/2023-05 Error [ERR_HTTP_HEADERS_SENT]: Cannot set headers after they are sent to the client
@calcom/web:start:     at new NodeError (node:internal/errors:387:5)
@calcom/web:start:     at ServerResponse.setHeader (node:_http_outgoing:644:11)
@calcom/web:start:     at ServerResponse._res.setHeader (/root/cal.com/node_modules/next/dist/server/base-server.js:180:24)
@calcom/web:start:     at setHeader (/root/cal.com/apps/web/.next/server/pages/_document.js:118:18)
@calcom/web:start:     at Function.getInitialProps (/root/cal.com/apps/web/.next/server/pages/_document.js:128:13)
@calcom/web:start:     at Object.<anonymous> (/root/cal.com/node_modules/next/dist/shared/lib/utils.js:84:33)
@calcom/web:start:     at Generator.next (<anonymous>)
@calcom/web:start:     at asyncGeneratorStep (/root/cal.com/node_modules/@swc/helpers/lib/_async_to_generator.js:13:28)
@calcom/web:start:     at _next (/root/cal.com/node_modules/@swc/helpers/lib/_async_to_generator.js:31:17)
@calcom/web:start:     at /root/cal.com/node_modules/@swc/helpers/lib/_async_to_generator.js:36:13
@calcom/web:start:     at new Promise (<anonymous>)
@calcom/web:start:     at Object.<anonymous> (/root/cal.com/node_modules/@swc/helpers/lib/_async_to_generator.js:28:16)
@calcom/web:start:     at Object.loadGetInitialProps (/root/cal.com/node_modules/next/dist/shared/lib/utils.js:62:33)
@calcom/web:start:     at loadDocumentInitialProps (/root/cal.com/node_modules/next/dist/server/render.js:682:48)
@calcom/web:start:     at renderDocument (/root/cal.com/node_modules/next/dist/server/render.js:732:45)
@calcom/web:start:     at /root/cal.com/node_modules/next/dist/server/render.js:769:114 {
@calcom/web:start:   code: 'ERR_HTTP_HEADERS_SENT'
@calcom/web:start: }
@maige-app maige-app bot added the 🐛 bug Something isn't working label May 5, 2023
@alishaz-polymath
Copy link
Member

What's the Calc.com release version you're using? Are you on our latest release?

@hotspot-app
Copy link
Author

I use the latest release version.

@alishaz-polymath
Copy link
Member

Strange. Do you have a test account you could lend me, I can take a deep dive and figure out what's going on behind the scenes 🙏
Please share them at: ali@cal.com

@PeerRich PeerRich added Low priority Created by Linear-GitHub Sync 1 points Created by SyncLinear.com labels May 14, 2023
@alishaz-polymath
Copy link
Member

Hey there @hotspot-app
Just following up: Can you please setup a test account and share the credentials with me so that I can take a deeper look at what's really going on?

@vsviridov
Copy link

I'm experiencing same issue with Baikal on the latest version.

@alishaz-polymath
Copy link
Member

Hi @vsviridov
Can you setup a test account for me and share at ali@cal.com please?
I can take a look there 🙌

@vsviridov
Copy link

vsviridov commented Jun 10, 2023

Hi @vsviridov Can you setup a test account for me and share at ali@cal.com please? I can take a look there 🙌

Hey Ali, which account do you want? Cal instance account or a baikal calendar account?

Sent you an email with credentials.

@alishaz-polymath
Copy link
Member

Hey @vsviridov
I've managed to get to the error mentioned in the issue. This is obviously not nicely handled (it will be very soon), however, this is an issue at the end of the Baikal CalDAV service provider.
Here's the reason behind the issue:

image

The response does not contain data, which is why we don't have anything coming back from the server, and the code expects object.data to never be undefined, it could be empty, but not undefined. Since it is undefined, it throws the error.

Essentially, I expected to see either empty (if it doesn't have any shareable event) or the event ICS in there, but instead it is undefined, meaning the server doesn't respond as expected for our fetch call.

@alishaz-polymath
Copy link
Member

I'm closing this issue right now, as it appears to be on the end of the Baikal Server itself, however, if I am mistaken here, please feel free to re-open this 🙏
Like I mentioned, the error will be handled better soon, thanks for raising the issue 👍

@vsviridov
Copy link

I can keep the credentials on the server for you to test later, or I can remove them. Please let me know...

@alishaz-polymath
Copy link
Member

Hey @vsviridov
You can remove them for now, I think. Once the Baikal server is working as expected, and if you still face the issue, feel free to hit me up via email or re-open this issue (if it's an issue on our end). 🙏
We can re-consider if we need the credentials again at that stage.

@nepomuc
Copy link

nepomuc commented Nov 29, 2023

Hey @vsviridov I've managed to get to the error mentioned in the issue. This is obviously not nicely handled (it will be very soon), however, this is an issue at the end of the Baikal CalDAV service provider. Here's the reason behind the issue:

image

The response does not contain data, which is why we don't have anything coming back from the server, and the code expects object.data to never be undefined, it could be empty, but not undefined. Since it is undefined, it throws the error.

Essentially, I expected to see either empty (if it doesn't have any shareable event) or the event ICS in there, but instead it is undefined, meaning the server doesn't respond as expected for our fetch call.

@alishaz-polymath I'm currently trying to find the code section that creates the undefined value of data in the response. But I don't really know how to create the correct request to trigger this unwanted response. Can you help? Best would be a CLI command.

@nepomuc
Copy link

nepomuc commented Nov 29, 2023

So

async fetchObjectsWithOptionalExpand({
is being used for checking the availability of a caldav calendar. It uses fetchCalendarObjects() from package "tsdav". So if anyone of you wants to start debugging, this info might be useful for you 👍

@apollo-sturdy
Copy link

For anyone having this issue, it is due to this bug: sabre-io/Baikal#1241

For a temporary fix you can re-create your Baikal calendars in iCal: sabre-io/Baikal#1085 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 points Created by SyncLinear.com 🐛 bug Something isn't working Low priority Created by Linear-GitHub Sync
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants
@vsviridov @nepomuc @PeerRich @alishaz-polymath @apollo-sturdy @hotspot-app and others