Heads up! We're sunsetting this forum to streamline our community space.

join us on Discord for support, updates, and all things Snap AR! See you there!
Sign up for our live Camera Kit office hour on July 17 @ 9:30am (PT) / 4:30pm (GMT)

Get camerakit lens repository timeout issue. Was working before just updated lens and now its broken

zPoly
zPoly Posts: 6
edited August 2023 in General #1

Request for https://api-kit.snapchat.com/com.snap.camerakit.v3.Lenses/groups/.../..../ timed out by client timeout handler

I updated the snapchat lens and now I'm getting a timed out issue. I have tested my api ket and lens/group id on the tester and they seem to be working. Does anyone have any insight?

EDIT: I am getting several "the server responded with a status of 404 ()" errors and then the request is timing out.

```useEffect(() => {
const main = async () => {
const apiToken = process.env.REACT_APP_JSON_WEB_TOKEN;
const cameraKit = await bootstrapCameraKit({ apiToken });

  const session = await cameraKit.createSession();
  session.events.addEventListener("error", (event) => console.error(event.detail));
  if (canvasRef.current) {
    canvasRef.current.replaceWith(session.output.live);
}

  const mediaStream = await navigator.mediaDevices.getUserMedia({
    video: { facingMode: { ideal: 'environment' } }
  });

  session.setSource(mediaStream, { cameraType: 'back' });

  const lens = await cameraKit.lensRepository.loadLens('...', '...');
  await session.applyLens(lens);
  await session.play();


  console.log("Lens rendering has started!");
  console.log(canvasRef.current);
};

const timeoutId = setTimeout(() => {
  setShowButton(true);
}, 12500);

main();

return () => clearTimeout(timeoutId);

}, []);```

Answers

  • stevenxu
    stevenxu Posts: 612 👻
    edited August 2023 #2

    @zPoly Created a ticket (5097) for our eng to investigate. In the meantime, could you also provide me any of the following info where applicable just in case:

    • Lens Name
    • Lens ID
    • CameraKit SDK version
  • zPoly
    zPoly Posts: 6

    @stevenxu
    Lens Name: Exclusible Collect
    CameraKit SDK: 0.11.0
    Lens ID: a1479d7c-a637-45a9-9eac-ad2cd3239800

  • stevenxu
    stevenxu Posts: 612 👻

    @zPoly Thanks for your patience. Here's what our eng shared:

    Without seeing the actual error, it's hard to say exactly what's going on. Typically, this error is seen for one of two reasons:

    1. Not using a version of their app that has Camera Kit enabled
    2. Not approved for Web SDK use

    We can rule out the second one. Did you create a new separate app or use a new organization?

    Try this:

    • Make sure to use the same organization that you initially selected in the onboarding process.
    • Select the same app version that you've used previously (assuming it worked there) and see if the issue still remains.
  • stevenxu
    stevenxu Posts: 612 👻

    @zPoly following up were you able to try the above?

  • zPoly
    zPoly Posts: 6

    @stevenxu Yes I did try those steps and after resetting the camera kit version back to 0.10.0 from 0.11.0 the app is working locally but when I push the app to production on Firebase I am getting the same issues as above. I think there may be some issue with the Snapchat Agree to use policy popup permissions.

    The popup is not coming up on the production version and the request for the lenses seems to be timing out without that permission. This is just a guess though as I cannot see any definitive logs.

  • zPoly
    zPoly Posts: 6

    Was able to solve this. Apparently, when I changed the lens it somehow messed with the authentication step before the request is sent to get the lens from the server. Anyway I restored my build back to version 0.10.0 and then rebuilt to the server and its working again. Will continue this thread if I change the lens and the issue re-emerges.

  • stevenxu
    stevenxu Posts: 612 👻

    @zPoly Yahoo!! Glad you were able to solve this. Thanks for closing the loop for everyone here.

Categories