Description
What happened?
Hi,
I just started a self-hosted instance via docker compose, and correctly setup the some users and pages.
When I come accros an unattended behaviour / error during the addition of a new block TableView.
Adding the TableView view block apparently work, and I'm able to add new record and interact with the existing one, but when you try to open one record the full UI freeze and you need to reload the page.
I was able to identify some console errors that occurs on the addition of the block TableView, following the screenshot:
Tested on the following browsers:
- Safari Version 18.0.1 (20619.1.26.31.7)
- Google Chrome Version 130.0.6723.92 (Official Build) (arm64) ]
I assume that the error are linked to the following request that fails in the browser:
## request
curl 'https://affine.carnevlu.com/graphql' \
-X 'POST' \
-H 'Content-Type: application/json' \
-H 'Accept: */*' \
-H 'Sec-Fetch-Site: same-origin' \
-H 'Accept-Language: en-GB,en;q=0.9' \
-H 'Accept-Encoding: gzip, deflate, br' \
-H 'Sec-Fetch-Mode: cors' \
-H 'Origin: https://affine.carnevlu.com' \
-H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.0.1 Safari/605.1.15' \
-H 'Content-Length: 607' \
-H 'Referer: https://affine.carnevlu.com/workspace/10a6ea8f-a55b-4036-b248-ee9a9e1ed30a/VyTnZPw3dcjHqyl8jNBBX' \
-H 'Sec-Fetch-Dest: empty' \
-H 'Cookie: affine_session=bcdafe7d-ee73-4ee5-af95-ecf2b873ec14; affine_user_id=b16f759d-fe89-43c8-8c12-09d9d37eb822' \
-H 'x-definition-name: currentUser' \
-H 'Priority: u=3, i' \
-H 'x-operation-name: getCopilotHistories' \
--data-binary '{"query":"\nquery getCopilotHistories($workspaceId: String!, $docId: String, $options: QueryChatHistoriesInput) {\n currentUser {\n copilot(workspaceId: $workspaceId) {\n histories(docId: $docId, options: $options) {\n sessionId\n tokens\n action\n createdAt\n messages {\n id\n role\n content\n attachments\n createdAt\n }\n }\n }\n }\n}","variables":{"workspaceId":"10a6ea8f-a55b-4036-b248-ee9a9e1ed30a","docId":"VyTnZPw3dcjHqyl8jNBBX","options":{"fork":false}},"operationName":"getCopilotHistories"}'
## result
{
"errors": [
{
"message": "Internal Server Error",
"locations": [
{
"line": 2,
"column": 76
}
],
"extensions": {
"code": "Internal Server Error",
"status": 500
}
},
{
"message": "Internal Server Error",
"locations": [
{
"line": 4,
"column": 5
}
],
"extensions": {
"code": "Internal Server Error",
"status": 500
}
}
]
}
And the following error on the running container affine-graphql:stable :
[Nest] 117 - 11/06/2024, 8:26:25 AM ERROR [GraphQL] Internal server error
GraphQLError: Cannot query field "copilot" on type "UserType".
at Object.Field (/app/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:51:13)
at Object.enter (/app/node_modules/graphql/language/visitor.js:301:32)
at Object.enter (/app/node_modules/graphql/utilities/TypeInfo.js:391:27)
at visit (/app/node_modules/graphql/language/visitor.js:197:21)
at validate (/app/node_modules/graphql/validation/validate.js:91:24)
at processGraphQLRequest (/app/node_modules/@apollo/server/dist/cjs/requestPipeline.js:101:61)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async internalExecuteOperation (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:644:16)
at async runHttpQuery (/app/node_modules/@apollo/server/dist/cjs/runHttpQuery.js:135:29)
at async runPotentiallyBatchedHttpQuery (/app/node_modules/@
Other informations:
- the instance is running on a intel base server
- the instance is served over HTTPS behind a proxy
the docker compose used for the instance is:
services:
affine:
image: ghcr.io/toeverything/affine-graphql:canary
container_name: affine_selfhosted
command:
['sh', '-c', 'node ./scripts/self-host-predeploy && node ./dist/index.js']
ports:
- '3010:3010'
- '5555:5555'
depends_on:
redis:
condition: service_healthy
postgres:
condition: service_healthy
volumes:
# custom configurations
- ./config:/root/.affine/config
# blob storage
- ./storage:/root/.affine/storage
logging:
driver: 'json-file'
options:
max-size: '1000m'
restart: unless-stopped
environment:
- NODE_OPTIONS="--import=./scripts/register.js"
- AFFINE_CONFIG_PATH=/root/.affine/config
- REDIS_SERVER_HOST=redis
- DATABASE_URL=postgres://affine:affine@postgres:5432/affine
- NODE_ENV=production
- [email protected]
- AFFINE_ADMIN_PASSWORD=SuperSecretTempPassword
- AFFINE_SERVER_HOST=affine.domain.com
- AFFINE_SERVER_HTTPS=true
# Telemetry allows us to collect data on how you use the affine. This data will helps us improve the app and provide better features.
# Uncomment next line if you wish to quit telemetry.
# - TELEMETRY_ENABLE=false
redis:
image: redis
container_name: affine_redis
restart: unless-stopped
volumes:
- ./redis:/data
healthcheck:
test: ['CMD', 'redis-cli', '--raw', 'incr', 'ping']
interval: 10s
timeout: 5s
retries: 5
postgres:
image: postgres
container_name: affine_postgres
restart: unless-stopped
volumes:
- ./postgres:/var/lib/postgresql/data
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U affine']
interval: 10s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: affine
POSTGRES_PASSWORD: affine
POSTGRES_DB: affine
PGDATA: /var/lib/postgresql/data/pgdata
Distribution version
macOS ARM 64 (Apple Silicon)
What browsers are you seeing the problem on if you're using web version?
Chrome, Safari
Are you self-hosting?
- Yes
Relevant log output
[Nest] 117 - 11/06/2024, 8:26:25 AM ERROR [GraphQL] Internal server error
GraphQLError: Cannot query field "copilot" on type "UserType".
at Object.Field (/app/node_modules/graphql/validation/rules/FieldsOnCorrectTypeRule.js:51:13)
at Object.enter (/app/node_modules/graphql/language/visitor.js:301:32)
at Object.enter (/app/node_modules/graphql/utilities/TypeInfo.js:391:27)
at visit (/app/node_modules/graphql/language/visitor.js:197:21)
at validate (/app/node_modules/graphql/validation/validate.js:91:24)
at processGraphQLRequest (/app/node_modules/@apollo/server/dist/cjs/requestPipeline.js:101:61)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async internalExecuteOperation (/app/node_modules/@apollo/server/dist/cjs/ApolloServer.js:644:16)
at async runHttpQuery (/app/node_modules/@apollo/server/dist/cjs/runHttpQuery.js:135:29)
at async runPotentiallyBatchedHttpQuery (/app/node_modules/@
Anything else?
