Closed pavzagor closed 1 year ago
Hi @pavzagor, thanks for reporting this issue! I've resolved it in the latest version - 0.0.3. Please upgrade to the latest version.
Hello. Even though I've upgraded notion-translator to 0.0.3 version the issue still remains
ruslanceboksarov@MacBook-Air-Ruslan ~ % npm list ruslanceboksarov@ /Users/ruslanceboksarov └── notion-translator@0.0.3
`@notionhq/client info: request start {
method: 'patch',
path: 'blocks/9f6d6a8f-53d4-4a2c-9c3b-ae30b1baf564/children'
}
@notionhq/client warn: request fail {
code: 'validation_error',
message: 'Content creation Failed. Fix the following: \n' +
"Could not find user with ID: 4664ffc2-a79c-4c82-8d0d-25c05c854116. Only members and guests in the integration's workspace are visible."
}
@notionhq/client debug: failed response body {
body: `{"object":"error","status":400,"code":"validation_error","message":"Content creation Failed. Fix the following: \\nCould not find user with ID: 4664ffc2-a79c-4c82-8d0d-25c05c854116. Only members and guests in the integration's workspace are visible."}`
}
/Users/ruslanceboksarov/.nvm/versions/node/v19.0.1/lib/node_modules/notion-translator/node_modules/@notionhq/client/build/src/errors.js:162
return new APIResponseError({
^
APIResponseError: Content creation Failed. Fix the following:
Could not find user with ID: 4664ffc2-a79c-4c82-8d0d-25c05c854116. Only members and guests in the integration's workspace are visible.
at buildRequestError (/Users/ruslanceboksarov/.nvm/versions/node/v19.0.1/lib/node_modules/notion-translator/node_modules/@notionhq/client/build/src/errors.js:162:16)
at Client.request (/Users/ruslanceboksarov/.nvm/versions/node/v19.0.1/lib/node_modules/notion-translator/node_modules/@notionhq/client/build/src/Client.js:304:54)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async /Users/ruslanceboksarov/.nvm/versions/node/v19.0.1/lib/node_modules/notion-translator/index.js:399:26 {
code: 'validation_error',
status: 400,
headers: Headers {
[Symbol(map)]: [Object: null prototype] {
date: [ 'Thu, 10 Nov 2022 09:12:59 GMT' ],
'content-type': [ 'application/json; charset=utf-8' ],
'content-length': [ '250' ],
connection: [ 'close' ],
'set-cookie': [
'notion_browser_id=692e2d40-a762-46d0-a183-59b826663097; Domain=www.notion.so; Path=/; Expires=Fri, 10 Nov 2023 09:12:59 GMT; Secure',
'notion_check_cookie_consent=false; Domain=www.notion.so; Path=/; Expires=Fri, 11 Nov 2022 09:12:59 GMT; Secure'
],
'content-security-policy': [
"script-src 'self' 'unsafe-inline' 'unsafe-eval' https://gist.github.com https://apis.google.com https://www.google.com https://www.gstatic.com https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://widget.intercom.io https://js.intercomcdn.com https://static.zdassets.com https://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://analytics.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://embed.typeform.com https://admin.typeform.com https://public.profitwell.com js.sentry-cdn.com https://js.chilipiper.com https://platform.twitter.com https://cdn.syndication.twimg.com https://accounts.google.com https://www.googletagmanager.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://metadata-static-files.sfo2.cdn.digitaloceanspaces.com https://platformapi.metadata.io https://cdn01.boxcdn.net;connect-src 'self' https://msgstore.www.notion.so wss://msgstore.www.notion.so ws://localhost:* ws://127.0.0.1:* https://notion-emojis.s3-us-west-2.amazonaws.com https://s3-us-west-2.amazonaws.com https://s3.us-west-2.amazonaws.com https://notion-production-snapshots-2.s3.us-west-2.amazonaws.com https://cdn.amplitude.com https://api.amplitude.com https://hkfxbbdzib.notion.so https://www.notion.so https://api.embed.ly https://js.intercomcdn.com https://api-iam.intercom.io https://uploads.intercomcdn.com wss://nexus-websocket-a.intercom.io https://ekr.zdassets.com https://ekr.zendesk.com\t https://makenotion.zendesk.com\t https://api.smooch.io\t wss://api.smooch.io\t https://logs-01.loggly.com https://http-inputs-notion.splunkcloud.com https://cdn.segment.com https://api.segment.io https://analytics.pgncs.notion.so https://api.pgncs.notion.so https://o324374.ingest.sentry.io https://checkout.stripe.com https://js.stripe.com https://cdn.contentful.com https://preview.contentful.com https://images.ctfassets.net https://www2.profitwell.com https://tracking.chilipiper.com https://api.chilipiper.com https://api.unsplash.com https://boards-api.greenhouse.io https://accounts.google.com https://oauth2.googleapis.com https://www.googletagmanager.com https://analytics.google.com https://www.googleadservices.com https://googleads.g.doubleclick.net https://region1.google-analytics.com https://region1.analytics.google.com https://www.google-analytics.com https://api-v2.mutinyhq.io https://client-registry.mutinycdn.com https://client.mutinycdn.com https://user-data.mutinycdn.com https://metadata-static-files.sfo2.cdn.digitaloceanspaces.com https://platformapi.metadata.io https://api.statuspage.io https://pgncd.notion.so https://api.statsig.com https://statsigapi.net https://exp.notion.so https://file.notion.so https://api.box.com;font-src 'self' data: https://cdnjs.cloudflare.com https://js.intercomcdn.com https://cdn01.boxcdn.net;img-src 'self' data: blob: https: https://platform.twitter.com https://syndication.twitter.com https://pbs.twimg.com https://ton.twimg.com https://region1.google-analytics.com https://region1.analytics.google.com;style-src 'self' 'unsafe-inline' https://cdnjs.cloudflare.com https://github.githubassets.com https://js.chilipiper.com https://platform.twitter.com https://ton.twimg.com https://accounts.google.com https://cdn01.boxcdn.net;frame-src https: http: https://accounts.google.com;media-src https: http: https://file.notion.so"
],
'x-dns-prefetch-control': [ 'off' ],
'x-frame-options': [ 'SAMEORIGIN' ],
'strict-transport-security': [ 'max-age=5184000; includeSubDomains' ],
'x-download-options': [ 'noopen' ],
'x-content-type-options': [ 'nosniff' ],
'x-permitted-cross-domain-policies': [ 'none' ],
'referrer-policy': [ 'strict-origin-when-cross-origin' ],
'x-xss-protection': [ '0' ],
etag: [ 'W/"fa-gF64dbew3UstziatZl/83dCY3f0"' ],
vary: [ 'Accept-Encoding' ],
'cf-cache-status': [ 'DYNAMIC' ],
server: [ 'cloudflare' ],
'cf-ray': [ '767dab6a7ace16cf-DME' ]
}
},
body: `{"object":"error","status":400,"code":"validation_error","message":"Content creation Failed. Fix the following: \\nCould not find user with ID: 4664ffc2-a79c-4c82-8d0d-25c05c854116. Only members and guests in the integration's workspace are visible."}`
}
Node.js v19.0.1`
Also I've attached JSON file that I've created after launching the following command: ruslanceboksarov@MacBook-Air-Ruslan ~ % notion-translator -d -f ru -t en-us -u https://www.notion.so/kodland/Magic-of-code-with-Scratch-M4L4-20-1-a262eabb5f4542a2a3d6bbc66ed3ece3
@pavzagor When you have mentions in a page, the API token needs to have the permission to read user information. Please update your integration settings at https://www.notion.so/my-integrations as below:
I will update the README to cover this pattern later.
We have following integration settings @seratch
I don't think it fails with the settings. Please make sure that you're using the correct token for running this tool
@seratch idk why but it worked - I've been using old integration token and now when it's updated it worked correctly. Thank you for you time!
Still breaks 😢
Details in the commit comment: https://github.com/seratch/notion-translator/commit/d5df5a0cd3f7ff5e3b9c1d6845fa825ddef79ad0#commitcomment-90249848
Gist
Seem to create the empty page but then fails with a 400 validation error. Might be something connected to Notion API changes (error is obviously from Notion API). It creates a page but then fails to fill it with elements.
I tried debugging myself but I'm not good at JS + don't really know how to debug CLIs.
I think it should be something simple. Perhaps some condition needed to ignore empty blocks. Judging from the output, the error is in one particular child block.
Inputs
ru → en-us Page for translation (accessible via seratch@gmail.com)
Output