"Unknown Resource" online, but works fine offline?

experiment link

Description of the problem:

I am trying to display a PNG image. It works offline from the builder, but online on Pavlovia I get the unknown resource error.

To reproduce:

  1. fork the stroop project
  2. add a new routine in the builder to show the image
  3. the image is called EXAMPLE.png, located directly inside the project folder
  4. run the python script from the psychopy builder, it should work
  5. compile to javascript and upload through the builder
  6. check to make sure the image was copied into resources/EXAMPLE.png
  7. try to pilot on pavlovia, get this error

In the past I have found that my ad blocker was preventing resources being found on Pavlovia. Worth disabling any ad blocker on the site.

Best wishes
Glen

Thanks for the idea, Glen. Unfortunately, turning off my adblocker didn’t make a difference.

Shame as it’s an easy fix :wink:

Another thing I think could affect is if the html/js is in a html folder rather than in the root folder with the task.

I’ve had to change the settings in the Online part of experiment info for that one.

I was hoping the fix would be that easy, oh well.

EXAMPLE.png is in the root folder. It gets copied to the html folder when you run the “compile js” action on the psychopy builder.

The latest version doesn’t work well with outputting to an html folder. You should recreate without it. Please see my many posts on this topic.

Hey @wakecarter, thanks for the reply. I checked out your document and found a reference to this error on page 21:

Use experiment settings (cog image in Builder) > online > +/- keys to add the list of resources your experiment will need.

So I did exactly this. The resources list in the cog settings now lists EXAMPLE.png as a resource. However, the error still unfortunately occurs.

Next, I tried to delete the whole html folder and recompile to js. This did not fix the error either.

Do you have a sense of what the issue might be and which of your many posts could contain the solution? Is there any further information I could provide that would help?

Did you recreate the experiment without the html folder or just try deleting it in the existing repository?

My posts are more up to date than my crib sheet on this point.

I tried looking through your posts, but I’m having trouble finding the right one.

I did find this: Online Experiment not loading Resources - #4 by D3njo

Following in D3njo’s footsteps, I:

  1. deleted the html folder
  2. deleted the .git folder
  3. did not delete the .gitignore folder, since this would cause additional issues
  4. renamed the folder, psyexp-file and other files with the old name
  5. changed the title of the experiment from the gear icon
  6. uploaded it as a new project (here)
  7. and tried piloting the experiment. The error still persists. :frowning:

I have a few minutes to write a reply now.

I have one experiment still using the html folder where I have set “Use PsychoPy Version” to 2020.2.3 in Experiment Settings.

For another experiment what I did was:

  1. Close the experiment in Builder.
  2. Download any existing data from Pavlovia.
  3. Delete the repository from Pavlovia.
  4. Delete the local .git folder.
  5. Delete the local html folder (after removing any files than only exist in it).
  6. Delete other unnecessary local files.
  7. Open the experiment in Builder.
  8. Check that Experiment Settings / Online / Output path is blank and Export HTML is on Sync.
  9. Press the “Sync with web project” icon to create a new project online.
  10. [Added 21 Feb 2022] If you now get an unknown resources error attached any resources defined in code via Experiment Settings / Online / Additional Resources in Builder.

For more info see the following posts.

3 Likes

I just tried this. First deleted the html folder. Next, went to settings and set psychopy version to 2020.2.3. Got the error:

Just followed these steps exactly, and it worked! No idea why, but I’m just happy to be past this. Thank you.

1 Like

Thanks for the confirmation. I’ve added these steps to my crib sheet.

1 Like

I have no idea why but following each of these steps fixed my 403 forbidden error! I didn’t even have to change anything, for some reason deleting things in this order worked. I had previously tried deleting everything and reopening on pavlovia via builder, and had also tried switching from piloting to inactive back to piloting. Have been working on this all day, thanks so much!

I followed these steps but the problem persists. I get an unknown resource message online where the appropriate file should load.

The repository: https://gitlab.pavlovia.org/petyaraczbme/hesp_baseline

The suspect part of the code in hesp_baseline.js the main exp js file is:

function randomChoice(arr) {
      return arr[Math.floor(arr.length * Math.random())];
  }
  
  fileList = ["list1.csv", "list2.csv", "list3.csv"];
  
  condsFile = randomChoice(fileList)

Since the online exp keeps looking for list1/list2/list3 at random, likely the randomChoice function works, but apparently condsFile being “list1.csv” is not good enough.

ed. problem persists after disabling adblocker and clearing browser cookies.

Have you added all three csv files to Experiments Settings / Online / Additional Resources?

https://psychopy.org/online/resources.html

With the inclusion of this step I’ve now failed forwards, so I’m moving to the appropriate topic!