instagram-private-api icon indicating copy to clipboard operation
instagram-private-api copied to clipboard

IgResponseError: POST /api/v1/qe/sync/ - 302 Found

Open michaelkoo3232 opened this issue 4 years ago • 12 comments

Bug Report

Read the Notes and fill out the form.

Notes

Your issue will be closed if you violate any rule below.

  • You need to include a meaningful section of your code (not your entire project and not a single line).
  • Please do not add screenshots as they're not easy to work with.
  • Errors like IgActionSpamError (feedback_required), IgCheckpointError (challenge_required), checkpont_required, login_required are "common" and there are multiple issues, search here.
  • You can delete this section after reading it.

Form

Put an [x] if you meet the condition, else leave [ ].

Requirements

  • [x] I've searched the Issues
  • [x] I've read the basic concepts
  • [x] I'm using the latest version
  • [ ] I've debugged my code using the DEBUG variable.

Platform

  • [x] I'm using Node.js version 12.18.2
  • [ ] I'm using electron
  • [ ] I'm using the browser YOUR_BROWSER_AND_VERSION
  • [ ] I'm using some other environment YOUR_ENV

Description

I am trying to login with a username and password. It works in the past. But after I pm2 restart once and it continue to show this error when I try to log in.

YOUR DESCRIPTION HERE

Code

Add a meaningful section of your code here. If you are using TypeScript replace js with typescript.

async function login(username, password) {
  console.log(username);
  console.log(password);
  try {
    const id = uuidv4();
    console.log(typeof id);
    await ig.state.generateDevice('uuidv4');
    await ig.simulate.preLoginFlow();
    const loggedInUser = await ig.account.login(username, password);
    await ig.simulate.postLoginFlow();
    // console.log('loggedInUser:');
    return loggedInUser;
  } catch (err) {
    // console.log('error');
    console.log(err);
    throw err;
  }
}

Error and Output

If you've got an error put it here. You can get the stacktrace in the most environments using Error.stack (MDN Docs).

IgResponseError: POST /api/v1/qe/sync/ - 302 Found;
    at Request.handleResponseError (/root/ig-dm/node_modules/instagram-private-api/dist/core/request.js:125:16)
    at Request.send (/root/ig-dm/node_modules/instagram-private-api/dist/core/request.js:53:28)
    at async QeRepository.sync (/root/ig-dm/node_modules/instagram-private-api/dist/repositories/qe.repository.js:28:26)
    at async AccountRepository.login (/root/ig-dm/node_modules/instagram-private-api/dist/repositories/account.repository.js:13:13)
    at async login (/root/ig-dm/routes/users.js:168:26)

michaelkoo3232 avatar Dec 03 '20 12:12 michaelkoo3232

I am having the same problem, I assume its a rate limit issue. Did you ever find a solution?

wkibbler avatar Jan 03 '21 22:01 wkibbler

I am also having same intermittently while running the script for aws instance.

itsmemz53 avatar Jan 14 '21 11:01 itsmemz53

I am having the same problem, I assume its a rate limit issue. Did you ever find a solution?

No, I did not find the solution. I just deploy the application to other machine. Initially It was deployed on a vultr VPS, now is a AWS instance

michaelkoo3232 avatar Jan 14 '21 13:01 michaelkoo3232

i have the same issue, is there a solution?

bayungrh avatar Apr 13 '21 17:04 bayungrh

I have the same issue. Everything works fine locally though.

fabiandiez avatar Apr 14 '21 07:04 fabiandiez

i have same issue

alihajiloo avatar Oct 25 '21 13:10 alihajiloo

Same issue, local server works but fails upon AWS EC2 instance. Any resolution for this?

ctle-vn avatar Oct 27 '21 12:10 ctle-vn

same here

sreza78 avatar Oct 27 '21 15:10 sreza78

Issue appears to be across all hosting providers

xetrics avatar Dec 17 '21 15:12 xetrics

Has this problem already been resolved?

sousaakira avatar Feb 15 '22 17:02 sousaakira

Any updates?

rafaelgdn avatar Jul 31 '22 18:07 rafaelgdn

You can't use a script on a VPS. Instagram is blocking it. Workaround: use ig.state.serialize to dump the credentials et al. on your local machine and then load it on the VPS using ig.state.deserialize. Only the login procedures are blocked by Instagram.

19h avatar Sep 03 '22 22:09 19h