.zip file problems

PennController for IBEX Forums Support .zip file problems

Viewing 15 posts - 16 through 30 (of 47 total)
  • Author
    Posts
  • #4923
    Jeremy
    Keymaster

    Hi Elise,

    What 404 error exactly are you referring to? The experiment at the link you gave works quite well for me: the zip file gets downloaded (as visible in the Logs tab of the Debugger: [15:17:19] Download of https://chaipictures.s3.eu-central-1.amazonaws.com/Pictures.zip complete (PennController: 31)) and the resources get preloaded normally.

    The Errors tab does report a few errors, but they have to do with your Template commands referencing tables named “Practice_N” (with N a number from 2 to 6) when the only tables you have in your experiment come from the files “Materials_fillers_Questions.csv,” “Materials_DO_Questions.csv,” “Materials_fillers_Pictures.csv,” “Materials.csv,” “Materials_DO_Pictures.csv”, and “Practice_1.csv” (the debugger suggests that you reference that file instead).

    It’s true that I do get a 404 error in the web console for https://expt.pcibex.net/ibexexps/Potsdam-experiments/Chai/1.jpg, but that’s because PennController always also looks for each resource file locally (ie. at the experiment’s URL) even if you use a ZIP file (or the AddHost command) and then uses the first file that is successfully resolved by one of the requests (local, zip, distant host).

    Best,
    Jeremy

    #4925
    tjuan
    Participant

    Hi,
    I have a similar problem going on. I don’t think my experiment was able to access the zip file properly. I followed the instructions in the documentation and uploaded a zip folder containing audio files(.WAV) to a school server along with the .htaccess, which the IT department said should work, but now I’m not really sure what’s going on. The debugger didn’t mention any type of error occurring as it was running the experiment.

    The link to my zip file is https://mfile.umich.edu/?path=/afs/umich.edu/user/t/j/tjuan/Public/Spanish%20Pupillometry%20Project%20Resources/Audio_Files.zip

    #4926
    Elise
    Participant

    Hi Jeremy,

    thanks for your fast reply!
    Yesterday it showed me the 404 error in the console. The pictures preloaded,but they were not displayed. When I click on the experiment today, it was working fine at first. After running the experiment a few times to check if all pictures are displayed correctly, the zip file got downloaded (reported in the debugger), but the pictures are not shown at all (also the pictures I load locally from PCIbex is not shown)

    This was shown in the console:

    server.py?include=js:880 Uncaught (in promise) TypeError: Cannot set property ‘style’ of null
    at l.uponCreation (server.py?include=js:880)
    at l.n.uponCreation (server.py?include=js:880)
    at server.py?include=js:880
    at new Promise (<anonymous>)
    at Array.<anonymous> (server.py?include=js:880)
    at server.py?include=js:873

    Most times I run the experiment, the pictures are shown, but sometimes nothing at all is displayed after the dashed sentence. I am afraid that this will happen when running the experiment with participants. Do you have an idea what is going on?

    #4927
    Jeremy
    Keymaster

    Hi,
    I have a similar problem going on. I don’t think my experiment was able to access the zip file properly. I followed the instructions in the documentation and uploaded a zip folder containing audio files(.WAV) to a school server along with the .htaccess, which the IT department said should work, but now I’m not really sure what’s going on. The debugger didn’t mention any type of error occurring as it was running the experiment.

    The link to my zip file is https://mfile.umich.edu/?path=/afs/umich.edu/user/t/j/tjuan/Public/Spanish%20Pupillometry%20Project%20Resources/Audio_Files.zip

    It appears that this URL is not a direct link to the zip file: you need to login onto the UMichigan portal before you can access the file. Not sure what the IT department told you, but this link clearly won’t work with PCIbex (or anything else for the matter, since access is password-protected). In addition to the CORS setup, you want to make sure you have a link that directly gives you the zip file when you use it in a new, private navigation session in your browser.

    Jeremy

    #4932
    Jeremy
    Keymaster

    Hi Elise,

    I’m not able to reproduce the bug on my end, but I think I know where the problem is coming from. Try replacing the replacePreloadingText function with this:

    let replacePreloadingText = ()=>{
        let mainPs = $(".PennController-PennController div p");
        if (mainPs.length == 2 && mainPs[0].innerHTML == "Please wait while the resources are preloading")
            mainPs.parent().empty().append('

    Laden...

    ') else window.requestAnimationFrame( replacePreloadingText ); }; window.requestAnimationFrame( replacePreloadingText );

    And create a file named global_z.css in your Aesthetics folder to define your nice preloading loop animation:

    .loader {
        border: 16px solid #f3f3f3;
        border-radius: 50%;
        border-top: 16px solid cadetblue;
        width: 120px;height: 120px;
        -webkit-animation: spin 2s linear infinite; /* Safari */
        animation: spin 2s linear infinite;
    }
    @-webkit-keyframes spin {
        0% { 
            -webkit-transform: rotate(0deg); 
            
        }100% { 
            -webkit-transform: rotate(360deg); 
            
        }
    }
    @keyframes spin {
        0% { 
            transform: rotate(0deg); 
        }
        100% { 
            transform: rotate(360deg); 
        }
    }

    Hopefully that should fix the HTML structure of your document and PennController should no longer fail to set the style of its DOM element

    Let me know if that fixed your problem

    Jeremy

    #4933
    tjuan
    Participant

    Hi Jeremy,
    So I did end up uploading the files to a different one where you can download the files immediately. Here is the link to that https://umich.box.com/shared/static/9sm0lhj6kub47gypwp7gaf35pylitrtj.zip

    However, the audio files still doesn’t load in the experiment. I noticed that when I convert the files from .wav to .mp4 and I upload it directly to the farm one by one it would work, but it’s a bit cumbersome since there’s a lot of files.

    • This reply was modified 4 years, 8 months ago by tjuan.
    #4935
    Jeremy
    Keymaster

    Hi,

    Did you make sure to properly configure the CORS settings with this new link? You need both a direct link to your file, and CORS access authorization to allow your participants’ browser to download the zip file automatically in the background

    Also, do you really to need to convert the files from wav to mp4 when you upload them to the farm? I thought it was coded so that it would serve wav files normally, but I’ll look into that

    I agree with you, it’s both cumbersome to upload individual audio files to the farm and it can also quickly use much of your allocated space—I’m working on a better installment of it though where you’ll be able to drag-n-drop multiple files at once, or even entire folders

    Jeremy

    #4937
    Elise
    Participant

    Hi Jeremy,

    I made the changes you proposed, but the error message still occurs in the console :/ (since two hours)

    I don’t think it has something to do with amazonaws, because one of the pictures that should appear after the dashed sentence is on the local server of PCIbex and this one is also not displayed:

    So the dashed sentence works perfectly fine and then my preloading message with the moving object appears. After a while it disappears and the page is empty except for the progress bar. I can just move to the next trial by using the sequence option of the debugger. So pressing the “j” or “f” key that normally leads to the next trial is also not working.

    What do you think: Should I try another server or is there something else I can try?

    Best,
    Elise

    #4938
    Jeremy
    Keymaster

    I’m pretty sure it’s not related to preloading the images per se (or only indirectly) as the error messages you get suggest that the script sometimes fails to build your page’s structure

    After reloading your experiment a few times, it did fail to preload the image 1.png on occasion—I think that what happens is that when your S3 bucket receives several requests for the ZIP file from the same address within a short delay, it can put those requests on hold to prevent too much traffic, and the default preloading time is not long enough for the zip files to be downloaded when those delays happen (I see you’ve been playing around with CheckPreloaded though, that’s probably a good idea since you can make the max preloading time longer)

    But again, when that happens, the trial loads fine in my browser, I just can’t see one of the two pictures, but I can still see the other one and I can press F or J to validate the trial. What browser do you use? Could it be Safari by any chance?

    Jeremy

    #4939
    Elise
    Participant

    I also thought it might be something browers specific: I use Opera. I also tried to run the experiment in Internet Explorer, but the same error appeared (page was empty after loading).
    But I tried it on two other computers with Firefox and Internet Explorer and it worked perfectly fine. So maybe it is a computer specific problem? I will ask some people to run the experiment and let you know if I could find out, if it’s just me facing this problem.

    I am glad to hear that the CheckPreloaded() command is also working with zip-files!

    Thank you for help!

    #4940
    Jeremy
    Keymaster

    I see, I didn’t realize there were issues specific to Opera with PennController

    If you’d like to give it a try, you could update your version of PennController (following the instructions on the documentation) using the branch dev-elise (you can always go back to 1.7 using the branch 1.7)—I updated a suspicious bit of code (based on the messages your console reported) hopefully that should fix the issue

    Jeremy

    #4941
    Elise
    Participant

    I tried it, but it said “ERROR: You must define the ‘items’ variable.”, when starting the experiment :/

    I also downloaded the Firefox and it’s not working. Could it be about my computer? I sent the link to five other people and it’s working fine for them.

    Best,
    Elise

    #4942
    Jeremy
    Keymaster

    Ah, I made a mistake and PennController didn’t compile correctly, that’s why you see this error message–my bad

    Maybe you made too many requests to your S3 bucket so that your new requests are somehow being blocked. But are you saying that you see the same problem on Firefox that you saw on Opera?

    Jeremy

    #4943
    Elise
    Participant

    Yes, I see it on Firefox (but only on my computer, for other computers firefox worked).

    Do you have other recommendations for a webserver? Maybe I should try another one than amazonaws to see if the same problem arises…

    Elise

    #4944
    Jeremy
    Keymaster

    I don’t have other recommendations, AWS is actually a decent choice because it is widely used, which increases the likelihood to see features being implemented and support on problems you might encounter

    I have updated the dev-elise branch to fix the error you were seeing, feel free to sync again and see whether the original error disappeared

    Also, I did find that S3 buckets do seem to have limits on the number of requests they can handle, but the numbers are quite high:

    Your applications can easily achieve thousands of transactions per second in request performance when uploading and retrieving storage from Amazon S3. Amazon S3 automatically scales to high request rates. For example, your application can achieve at least 3,500 PUT/COPY/POST/DELETE or 5,500 GET/HEAD requests per second per prefix in a bucket. There are no limits to the number of prefixes in a bucket. You can increase your read or write performance by parallelizing reads. For example, if you create 10 prefixes in an Amazon S3 bucket to parallelize reads, you could scale your read performance to 55,000 read requests per second.

    https://docs.aws.amazon.com/AmazonS3/latest/dev/optimizing-performance.html

    So I’m not sure how it could have happened, but if you’re the only one experiencing this problem and it happens across browsers, chances are that your IP has been flagged on aws, or something like that…

    Jeremy

Viewing 15 posts - 16 through 30 (of 47 total)
  • You must be logged in to reply to this topic.