Error when exporting to HTML to post to Pavlovia

Hi,

OS: Win10
PsychoPy version: v2025.2.4
Standard Standalone Installation? (y/n) : Not entirely sure what this is asking, but this error came up when exporting the study as HTML from the builder mode
Do you want it to also run online? Y
What are you trying to achieve?: I am trying to link my psychopy experiment to pavlovia. I was following some advice from a video which suggested I export the study as an HTML file, then upload to pavlovia. If this is not the most efficient way to link my study to pavlovia, I would also appreciate any advice there as well. The goal for posting to pavlovia is then to embed a link from pavlovia at the end of a qualtrics survey.

Here is the error it gave me:

Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\wx\core.py”, line 3425, in
lambda event: event.callable(*event.args, **event.kw) )
File “C:\Program Files\PsychoPy\lib\site-packages\wx\lib\agw\aui\framemanager.py”, line 6395, in DoUpdate
self.Repaint()
File “C:\Program Files\PsychoPy\lib\site-packages\wx\lib\agw\aui\framemanager.py”, line 8530, in Repaint
client_dc = wx.BufferedDC(wx.ClientDC(self._frame), wx.Size(w, h))
wx._core.wxAssertionError: C++ assertion “m_buffer && m_buffer->IsOk()” failed at …\src\common\dcbufcmn.cpp(135) in wxBufferedDC::UnMask(): invalid backing store

Similar post from forum: I tried following advice from this previous post Error exporting HTML files about updating psychopy, but it did not help, as my computer said “psychopy could not connect to the internet to check for more recent versions. Check proxy settings in preferences.” However, in preferences I can see that autoProxy, allowUsageStats, and checkForUpdates are all selected.

Any help and direction would be appreciated!

When I get “invalid backing store” I either ignore it or close the Coder window and try again.

As Wakefield says, you can ignore this; essentially, syncing to Pavlovia opens your experiment (as a JS file) in Coder view, and this is an error with the interface of Coder view. Failing to open Coder doesn’t stop the sync, so your experiment should still have synced to Pavlovia.

The error arises from the package we use to make the PsychoPy Standalone app, which is fairly old and poorly maintained. This is a large part of the reason for us developing PsychoPy Studio, a full rebuild of the app using a more modern framework. If this error is recurring often, it may be worth switching to Studio. If you need version 2025.2.4 specifically, you can set it as the “Use version” parameter in Experiment Settings and Studio will install that version of the PsychoPy library to run your experiment in.

When I try to sync with pavlovia I am now receiving this error:

“Traceback (most recent call last):
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\coder\coder.py”, line 2879, in onPavloviaSync
pavlovia_ui.syncProject(parent=self, file=self.currentDoc.filename, project=self.project)
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 798, in syncProject
createDlg = sync.CreateDlg(parent,
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\app\pavlovia_ui\sync.py”, line 72, in init
self.namespaceCtrl = wx.Choice(self, choices=[user[‘username’]] + user.session.listUserGroups(namesOnly=True))
File “C:\Program Files\PsychoPy\lib\site-packages\psychopy\projects\pavlovia.py”, line 425, in listUserGroups
gps = self.gitlab.groups.list(member=True)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\exceptions.py”, line 346, in wrapped_f
return f(*args, **kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\mixins.py”, line 221, in list
obj = self.gitlab.http_list(path, iterator=iterator, **data)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py”, line 903, in http_list
gl_list = GitlabList(self, url, query_data, get_next=False, **kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py”, line 1163, in init
self._query(url, query_data, **self._kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py”, line 1173, in _query
result = self._gl.http_request(“get”, url, query_data=query_data, **kwargs)
File “C:\Program Files\PsychoPy\lib\site-packages\gitlab\client.py”, line 764, in http_request
raise gitlab.exceptions.GitlabAuthenticationError(
gitlab.exceptions.GitlabAuthenticationError: 401: invalid_token”

Any more advice would be appreciated! :slight_smile:

I get “invalid token” most days when I’m working with PsychoPy, especially when using an older version.

I close and reopen PsychoPy and re-logon to Pavlovia (from Builder). Sometimes just one of the two is sufficient.

For the “invalid_token” issue (which I think is different to the original post) what version of PsychoPy are you using?