P
Postiz2mo ago
Support

Ticket: Error Linking Social Accounts: Unexpected Token JSON Parse

@Spleenix Just created a ticket
Question: I am trying to link accounts from LinkedIn, Facebook and Instagram. When I try to link them, the error is always thrown when I redirect back to postiz: Application error: a server-side exception has occurred (see the server logs for more information). Digest: 4057080649 In the console: postiz | SyntaxError: Unexpected token '<', “<!DOCTYPE ”... is not valid JSON postiz | at JSON.parse (<anonymous>) postiz | at parseJSONFromBytes (node:internal/deps/undici/undici:5472:19) postiz | at successSteps (node:internal/deps/undici/undici:5454:27) postiz | at fullyReadBody (node:internal/deps/undici/undici:4381:9) postiz | at process.processTicksAndRejections (node:internal/process/task_queues:95:5) postiz | at async consumeBody (node:internal/deps/undici/undici:5463:7) postiz | at async is (/app/dist/apps/frontend/.next/server/app/(site)/integrations/social/[provider]/continue/page.js:3:27386) { postiz | digest: '4057080649' postiz | } I'm running docker compose on localhost using nginx for domain redirect and https)
Attempted: Checked Provider APIs
Working On: Adding Accounts
Take it from here @Postiz
7 Replies
Nevo David
Nevo David2mo ago
@Spleenix Please drop in your .env
xcons
xcons2mo ago
@Spleenix , could you also go to your browser console, and select the "response" on the network request, and take a screenshot of that? It looks like either Postiz or the Meta API is giving us a page when we are expecting JSON
Spleenix
Spleenix2mo ago
version: '3.8'

services:
postiz:
image: ghcr.io/gitroomhq/postiz-app:latest
container_name: postiz
restart: always
environment:
MAIN_URL: "https://postiz.local"
FRONTEND_URL: "https://postiz.local"
NEXT_PUBLIC_BACKEND_URL: "https://postiz.local/api"
JWT_SECRET: "random-unique-string"
DATABASE_URL: "postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local"
REDIS_URL: "redis://postiz-redis:6379"
BACKEND_INTERNAL_URL: "http://postiz:5000"
IS_GENERAL: "true"
STORAGE_PROVIDER: "local"
UPLOAD_DIRECTORY: "/uploads"
LINKEDIN_CLIENT_ID: "hiddenid"
LINKEDIN_CLIENT_SECRET: "hidden"
INSTAGRAM_APP_ID: "hiddenid"
INSTAGRAM_APP_SECRET: "hidden"
FACEBOOK_APP_ID: "hiddenid"
FACEBOOK_APP_SECRET: "hidden"
NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
volumes:
- postiz-config:/config/
- postiz-uploads:/uploads/
ports:
- 5000:5000
networks:
- postiz-network
depends_on:
postiz-postgres:
condition: service_healthy
postiz-redis:
condition: service_healthy

nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./certificates:/etc/nginx/certs
networks:
- postiz-network
depends_on:
- postiz


postiz-postgres:
image: postgres:14.5
container_name: postiz-postgres
restart: always
environment:
POSTGRES_PASSWORD: postiz-password
POSTGRES_USER: postiz-user
POSTGRES_DB: postiz-db-local
volumes:
- postgres-volume:/var/lib/postgresql/data
ports:
- 5433:5432
networks:
- postiz-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postiz-user -d postiz-db-local"]
interval: 10s
timeout: 3s
retries: 3
version: '3.8'

services:
postiz:
image: ghcr.io/gitroomhq/postiz-app:latest
container_name: postiz
restart: always
environment:
MAIN_URL: "https://postiz.local"
FRONTEND_URL: "https://postiz.local"
NEXT_PUBLIC_BACKEND_URL: "https://postiz.local/api"
JWT_SECRET: "random-unique-string"
DATABASE_URL: "postgresql://postiz-user:postiz-password@postiz-postgres:5432/postiz-db-local"
REDIS_URL: "redis://postiz-redis:6379"
BACKEND_INTERNAL_URL: "http://postiz:5000"
IS_GENERAL: "true"
STORAGE_PROVIDER: "local"
UPLOAD_DIRECTORY: "/uploads"
LINKEDIN_CLIENT_ID: "hiddenid"
LINKEDIN_CLIENT_SECRET: "hidden"
INSTAGRAM_APP_ID: "hiddenid"
INSTAGRAM_APP_SECRET: "hidden"
FACEBOOK_APP_ID: "hiddenid"
FACEBOOK_APP_SECRET: "hidden"
NEXT_PUBLIC_UPLOAD_DIRECTORY: "/uploads"
volumes:
- postiz-config:/config/
- postiz-uploads:/uploads/
ports:
- 5000:5000
networks:
- postiz-network
depends_on:
postiz-postgres:
condition: service_healthy
postiz-redis:
condition: service_healthy

nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./certificates:/etc/nginx/certs
networks:
- postiz-network
depends_on:
- postiz


postiz-postgres:
image: postgres:14.5
container_name: postiz-postgres
restart: always
environment:
POSTGRES_PASSWORD: postiz-password
POSTGRES_USER: postiz-user
POSTGRES_DB: postiz-db-local
volumes:
- postgres-volume:/var/lib/postgresql/data
ports:
- 5433:5432
networks:
- postiz-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postiz-user -d postiz-db-local"]
interval: 10s
timeout: 3s
retries: 3
postiz-redis:
image: redis:7.2
container_name: postiz-redis
restart: always
ports:
- 6380:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
volumes:
- postiz-redis-data:/data
networks:
- postiz-network

volumes:
postgres-volume:
external: false
postiz-redis-data:
external: false
postiz-config:
external: false
postiz-uploads:
external: false

networks:
postiz-network:
external: false
postiz-redis:
image: redis:7.2
container_name: postiz-redis
restart: always
ports:
- 6380:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 3s
retries: 3
volumes:
- postiz-redis-data:/data
networks:
- postiz-network

volumes:
postgres-volume:
external: false
postiz-redis-data:
external: false
postiz-config:
external: false
postiz-uploads:
external: false

networks:
postiz-network:
external: false
Using docker-compose file for env
Spleenix
Spleenix2mo ago
No description
No description
xcons
xcons2mo ago
@Spleenix very good, you see from that screenshot, what under the "Response" tab, next to headers? Oh actually I see it Okay, give me some time to try and reproduce this
Support
SupportOP2mo ago
@Postiz please help @Spleenix
Spleenix
Spleenix2w ago
Anything new? :)

Did you find this page helpful?