Push service isn't working
# main
m
TLDR: Slack sync not working I'm running Linen locally and followed the exact instructions for setting up Slack sync. but when I visit
http://localhost:3000/api/sync?account_id=MY_ACCOUNTID
nothing is happening. Not sure what I'm doing wrong. Also, I'm unsure on setting up discord sync
k
!mc I wouldn't recommend using the api/sync method for syncing if you are self hosting. We built that initially when we didn't have the frontend and is probably broken. I would recommend you get set up with the client side and create a community and press the sync button. You also need to set up https://github.com/Linen-dev/linen.dev/blob/main/docs/getting-started.md#optional-local-domain-redirect-testing as well as create a Slack app for it to work. Can you tell me a bit more about your use case?
m
Hi, I set up the redirect as well with ngrok. But when I press Connect to Slack -> allow in Slack channel It simply returns
"message": "Not Found"
as a response. Usecase: I want to make my slack conversations indexable
k
Do you have a Slack app created? You need to create and set up a Slack app with your Ngrok url infomation
m
Yes I did.
s
hi @mc, since sync job is a long running task, you will need to start the queue service, try with
yarn td queue
on root folder. This will run the queue service on development mode
m
Ah. let me try this
Hi, I ran the command
yarn td queue
and getting the error
BOT_SENDER_ID: Invalid number input: "number"
Kam @sandro2 I couldn't fix the problem
I started the push service and it's accessible at
localhost:4000
After logging in as a user I see a WebSocket connection in the Network Tab. Still, the messages aren't realtime. I'm testing it locally.
s
hi mc, you will need to run the push service in another terminal, check the push readme for more info about how to start it https://github.com/Linen-dev/linen.dev/tree/main/apps/push_service
since you only need the sync I would recommend you to remove all tasks from your queue except the "sync", https://github.com/Linen-dev/linen.dev/blob/main/packages/queue/src/index.ts#L57
m
Hi sandro. Yes, I started push service in another terminal. When I open the chat interface in browser, phoenix server is logging a client connection has been established. Still I don't recieve messages in realtime
2023-08-29_11-20.png
2023-08-29_11-21.png
Here is what's happening. In the Linen admin area under Settings > Configurations > Sync all history (Checked) I clicked Connect to Slack Button > I got the below attached prompt > I clicked Allow button. Now I got this error
Copy code
https://3833-210-22-140-53.ngrok-free.app/api/auth?code=2151774752.5800380254231.14ab6ab28c0b9ea01c62086302631dac2d9b6648fc6f6fd4a1&state=f4a58e25-8c55-4430-bb85-359b63970bae

{
  "message": "Not Found"
}
2023-08-29_11-33.png
e
there might be some env params missing, please have a look at the dev folder for an example startup script
s
hey mc, our push service is for receiving messages from linen chat in realtime. Can you try to open another browser or incognito, signin with another user and chat, that should be working. If you want to receive messages from slack you have to enable the "webhook" queue task https://github.com/Linen-dev/linen.dev/blob/main/packages/queue/src/index.ts#L68
m
Hi sandro, It wasn't working because of missing env. It's solved. Thanks sandro & emil
Hi sandro, ah, my mistake, it got connected. But when I send a message from slack. In the ngrok console, I see a request to webhook from slack side, still the messages ane not appearing in the linen
s
If you want to receive messages from slack you have to enable the "webhook" queue task https://github.com/Linen-dev/linen.dev/blob/main/packages/queue/src/index.ts#L68
m
Yes, it is enabled already. My question is. The slack app is being added to only one channel in slack. In that case, Do I have to manually create that channel in linen.dev or it'll be automatically created when the slack connection is made
s
It'll be automatically created. Only public channels will be synced with linen.
m
Not sure why, the channel is not being created automatically
s
did you manage to run the initial sync? did the sync created the slack channels on linen? did you manage to send a message in slack into some of these channels and see it on linen?
m
with the configuration settings, I managed to connect it to Slack. Once the channel is selected, it just redirects to the linen configuration page. No channel is being created and no messages are appearing. When I send a new message in slack, it's triggering the webhook endpoint, which I can see in the ngrok console. But nothing is happening
not sure what I'm doing wrong
I have tired multiple times, still no luck
k
Any reason to not use the free tier of Linen?
m
We are experimenting with the self-hosted version.
184 Views