Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Иногда возникает странная ошибка при загрузке фото через upload.wallPhoto #576

Open
woophi opened this issue Nov 28, 2024 · 1 comment
Labels
package: vk-io Issues related to vk-io

Comments

@woophi
Copy link

woophi commented Nov 28, 2024

What did you do?

const uploadApi = await this.vkApiv2.getApi(postData.vkUserId, 'parallel');
const upload = new Upload({
  api: uploadApi,
});
const savedData = await upload.wallPhoto({
    source: {
      value: filePath,
    },
    group_id: postData.vkGroupId,
  });

  return `photo${savedData.ownerId}_${savedData.id}`;

What did you expect to happen?

фото грузится без ошибки

What was the actual result?

2024-11-25T22:31:01: SyntaxError: Unexpected token 'S', "Security Breach2" is not valid JSON
    at JSON.parse (<anonymous>)
    at Response.json (file:///var/www/vk-poster-bot/node_modules/.pnpm/[email protected]/node_modules/node-fetch/src/body.js:149:15)
    at processTicksAndRejections (node:internal/process/task_queues:95:5)
    at Upload.upload (/var/www/vk-poster-bot/node_modules/.pnpm/[email protected][email protected]/node_modules/vk-io/lib/index.js:8380:28)
    at Upload.conduct (/var/www/vk-poster-bot/node_modules/.pnpm/[email protected][email protected]/node_modules/vk-io/lib/index.js:8267:26)
    at Upload.wallPhoto (/var/www/vk-poster-bot/node_modules/.pnpm/[email protected][email protected]/node_modules/vk-io/lib/index.js:7750:25)
    at PostUtilsService.saveAttachment (/var/www/vk-poster-bot/src/admin/posts/post-utils.service.ts:57:27)
    at PostCreateService.createPost (/var/www/vk-poster-bot/src/admin/posts/post-create.service.ts:133:34)
    at VkPostProcessor.startPosting (/var/www/vk-poster-bot/src/admin/posts/post.processor.ts:38:5)

Additional Info

создаю массовый постинг в несколько групп. для этого постинга используются все время одни и теже картинки. в итоге получается что у некоторых групп грузит нормально, а у каких-то отваливается. при чем вообще не связано на какой группе может отвалиться. иногда вообще без ошибок проходит

Versions

package version
vk-io 4.9.1
node 20.17.0
TypeScript 5.1.3
pnpm 9.14.2
@woophi woophi added the package: vk-io Issues related to vk-io label Nov 28, 2024
@negezor
Copy link
Owner

negezor commented Nov 29, 2024

Быстрый поиск в гугле показал что это какая-то рудиментная ошибка при загрузке в группу фото/видео.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: vk-io Issues related to vk-io
Projects
None yet
Development

No branches or pull requests

2 participants