PusherRequestError 404 #7
Answered
by
rahulhaque
codelonesomest
asked this question in
Q&A
|
I have tried the default Docker socket using: docker run -p 6001:6001 -p 9601:9601 quay.io/soketi/soketi:latest-16-alpine. It works fine for me. However, when running your codebase, I keep getting a PusherRequestError 404 error whenever Pusher triggers a message. ⨯ unhandledRejection: Error
at new RequestError (/Users/name/Desktop/name/name/apps/name/.next/server/chunks/ssr/08b5e_bfe018._.js:308:18)
at /Users/name/Desktop/name/name/apps/name/.next/server/chunks/ssr/08b5e_bfe018._.js:461:23
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
name: 'PusherRequestError',
message: 'Unexpected status code 404',
url: 'http://localhost:6002/apps/1/events?auth_key=2b2d26f1fa140beb1dd2d5ddbdccdbc0&auth_timestamp=1718386075&auth_version=1.0&body_md5=48f5748b1cd07465502dcd3082dbb58f&auth_signature=1dcdea275f9c1458b3ef37178441789745a494cf12cc07f3315427c771110064',
error: undefined,
status: 404,My setup:APP_NAME='Soketi App Manager'
APP_PORT=6002
APP_ENV=production
APP_KEY=base64:iRNXhuphwJ4TnJUYYD73wGs+GK6TCOf/43+WIY0xu2E=
APP_DEBUG=false
APP_URL="http://localhost:${APP_PORT}"
METRICS_HOST=http://soketi:9601
LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug
DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=3306
DB_DATABASE=soketi_app_manager
DB_USERNAME=soketi
DB_PASSWORD=password
BROADCAST_DRIVER=log
CACHE_DRIVER=redis
FILESYSTEM_DISK=local
QUEUE_CONNECTION=sync
SESSION_DRIVER=redis
SESSION_LIFETIME=120
MEMCACHED_HOST=127.0.0.1
REDIS_HOST=redis
REDIS_PASSWORD=password
REDIS_PORT=6379
MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="hello@example.com"
MAIL_FROM_NAME="${APP_NAME}"
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false
PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_HOST=127.0.0.1
PUSHER_PORT=443
PUSHER_SCHEME=https
PUSHER_APP_CLUSTER=mt1
VITE_APP_NAME="${APP_NAME}"
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
VITE_PUSHER_HOST="${PUSHER_HOST}"
VITE_PUSHER_PORT="${PUSHER_PORT}"
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
# --------------------
# Soketi Configuration
#
# Do not set variables like SOKETI_DEBUG="${APP_DEBUG}" as Soketi cannot parse them.
#
# See available variables here - https://github.com/soketi/soketi/blob/1.x/src/cli/cli.ts
# Use variables with prefix 'SOKETI_'.
#
# See availabe soketi.json config here - https://github.com/soketi/soketi/blob/1.x/src/server.ts
# --------------------
SOKETI_DEBUG=false
SOKETI_METRICS_ENABLED=true
SOKETI_WEBHOOKS_BATCHING=true
SOKETI_APP_MANAGER_CACHE_ENABLED=true
SOKETI_DB_POOLING_ENABLED=true
SOKETI_HOST=0.0.0.0
SOKETI_PORT=6001
SOKETI_METRICS_HOST=0.0.0.0
SOKETI_METRICS_SERVER_PORT=9601
SOKETI_QUEUE_DRIVER=redis
SOKETI_CACHE_DRIVER=redis
SOKETI_RATE_LIMITER_DRIVER=redis
SOKETI_DB_MYSQL_HOST=mysql
SOKETI_DB_MYSQL_PORT=3306
SOKETI_DB_MYSQL_USERNAME=soketi
SOKETI_DB_MYSQL_PASSWORD=password
SOKETI_DB_MYSQL_DATABASE=soketi_app_manager
SOKETI_APP_MANAGER_DRIVER=mysql
SOKETI_APP_MANAGER_MYSQL_TABLE=applications
SOKETI_APP_MANAGER_MYSQL_USE_V2=true # Change this if you're having issue connecting to MySQL
SOKETI_APP_MANAGER_CACHE_TTL=3600
SOKETI_DB_REDIS_HOST=redis
SOKETI_DB_REDIS_PORT=6379
SOKETI_DB_REDIS_USERNAME=
SOKETI_DB_REDIS_PASSWORD=password
SOKETI_DB_REDIS_DB=0
SOKETI_DB_REDIS_KEY_PREFIX=soketi_
Soketi ManagerClient site:const pusher = new pusherJs("2b2d26f1fa140beb1dd2d5ddbdccdbc0", {
cluster: "",
wsHost: "localhost",
wsPort: 6002,
forceTLS: false,
disableStats: true,
enabledTransports: ["ws", "wss"],
});
pusher.subscribe("chat-room").bind("message", (message: any) => {
console.log(`${message.sender} says: ${message.content}`);
});Server site:const pusher = new Pusher({
cluster: "",
appId: "1",
key: "2b2d26f1fa140beb1dd2d5ddbdccdbc0",
secret: "562a09ee06060220cfa4d53db509e828",
port: "6002",
host: "localhost",
});
pusher.trigger("chat-room", "message", {
id: "123",
sender: "John Doe",
content: "Hello, World!",
});Please let me know if you spot any mistakes. Thank you. |
Answered by
rahulhaque
Jun 15, 2024
Replies: 2 comments 4 replies
|
It seems you're running it with docker compose. If you're, can you try with |
2 replies
No it's not. It should work fine without exposing soketi port. I've pushed a minor change. Can you please pull the latest code, rebuild the container and run the code. Make sure to clean any build cache before. |
2 replies
Answer selected by
codelonesomest
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment

No it's not. It should work fine without exposing soketi port. I've pushed a minor change. Can you please pull the latest code, rebuild the container and run the code. Make sure to clean any build cache before.