# PsychoPy encountered an unhandled internal error: unable to push changed on Pavlovia

**URL:** <https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105>\
**Category:** Online experiments\
**Created:** [September 24, 2021, 8:50pm UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105 "2021-09-24T20:50:13Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarinaIosifian](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/marinaiosifian/32/7507_2.png) [@MarinaIosifian](https://discourse.psychopy.org/u/MarinaIosifian)\
**Post date:** [September 24, 2021, 8:50pm UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/1 "2021-09-24T20:50:13Z")

</div>

I am unable to push changes I made to Pavlovia, for some reason. I checked my JS code components and they look fine. Any ideas on this will be much appreciated

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/2/0251cc40b2d464fe9483d8c9e9bbf10c46e343bb.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [September 25, 2021, 8:01am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/2 "2021-09-25T08:01:27Z")

</div>

Tell me about condition?

Are you possibly using it for more than one thing?

---

<div class="post-metadata">

**Author:** ![MarinaIosifian](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/marinaiosifian/32/7507_2.png) [@MarinaIosifian](https://discourse.psychopy.org/u/MarinaIosifian)\
**Post date:** [September 25, 2021, 8:17am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/3 "2021-09-25T08:17:42Z")

</div>

Thanks, I checked this - I don’t think so. I also renamed it to “variant” and still got the same error.  
This is the JS code I use with it:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/a/cab976eeadade439f100d1c27f3db86f2fc24eac.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [September 25, 2021, 9:01am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/4 "2021-09-25T09:01:59Z")

</div>

Set up the function in Before Experiment or format it as per my crib sheet.

I’d recommend using Auto code components and coding in Python.

---

<div class="post-metadata">

**Author:** ![MarinaIosifian](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/marinaiosifian/32/7507_2.png) [@MarinaIosifian](https://discourse.psychopy.org/u/MarinaIosifian)\
**Post date:** [September 25, 2021, 10:07am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/5 "2021-09-25T10:07:06Z")

</div>

Thanks, I used your crib sheet:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/f/cf390ce8774d0ed439d2601d6ed89e17ffe98414.png)  
I need to create a variable condition which is a random number from 1 to 4. For some reason, I get the same error. It is specifically related to the code component and its routine. If I delete both, the experiment loads on Pavlovia without an error…

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [September 25, 2021, 11:04am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/6 "2021-09-25T11:04:05Z")

</div>

Your function has 1 and 5 instead of variable names such as min and maxplusone.

---

<div class="post-metadata">

**Author:** ![MarinaIosifian](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/marinaiosifian/32/7507_2.png) [@MarinaIosifian](https://discourse.psychopy.org/u/MarinaIosifian)\
**Post date:** [September 25, 2021, 11:22am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/7 "2021-09-25T11:22:01Z")

</div>

Thank you, I changed it now, but the same error occurs! It’s just so strange

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/3/e/3ee407ec1660ecb0306a066c709f1cc70ac8fb40.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [September 25, 2021, 2:50pm UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/8 "2021-09-25T14:50:33Z")

</div>

> [@MarinaIosifian](#):
>
> I don’t think so. I also renamed it to “variant” and still got the same error.

I assume you got variant is not defined

---

<div class="post-metadata">

**Author:** ![MarinaIosifian](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/marinaiosifian/32/7507_2.png) [@MarinaIosifian](https://discourse.psychopy.org/u/MarinaIosifian)\
**Post date:** [September 25, 2021, 10:42pm UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/9 "2021-09-25T22:42:46Z")

</div>

No, I got the condition is not defined:

![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/5/75b0914d89e0e728935177f79d3a28924a42b4cc.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [September 26, 2021, 6:24am UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/10 "2021-09-26T06:24:06Z")

</div>

Define the function in Before Experiment

Define condition in Begin Experiment

If you try changing condition to variant, in needs to be changed in both locations.  
I would recommend defining it in Python as well as JS.

---

<div class="post-metadata">

**Author:** ![MarinaIosifian](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/marinaiosifian/32/7507_2.png) [@MarinaIosifian](https://discourse.psychopy.org/u/MarinaIosifian)\
**Post date:** [September 26, 2021, 12:01pm UTC](https://discourse.psychopy.org/t/psychopy-encountered-an-unhandled-internal-error-unable-to-push-changed-on-pavlovia/25105/11 "2021-09-26T12:01:35Z")

</div>

I tried to do that - I changed everything to varient1. I also mentioned that I forgot the “;” in the line “condition = randint(1,4)”  
I also now use A,B,C,D instead of 1,2,3,4  
Before experiment tab looks like this:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/5/459486703cf9baa20ea1c4f44b40bfe24765ff1c.png)

Begin experiment tab:

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/e/fe2423a46daa740d7941e469d6a5e18790ac0cd6.png)

This option worked here:

> [@Between-subject counterbalancing via pavlovia](https://discourse.psychopy.org/t/between-subject-counterbalancing-via-pavlovia/8598/5):
>
> From what I’ve learned, I don’t think sequential ordering is possible with conditions. Your best option would be to create two separate .psyexp experiments and share the link sequentially for each signup. If, however, you are able to use the same experiment and simply change the .xlsx file, you can write a piece of code that will randomize which file (condition) is chosen. Then you can just keep a tally on each condition until a certain quota is reached, and continue experiments using the other…

But for some reason I still get the same error that varient1 is not defined…
