Forum

Images not showing

I just installed TAO 3.3-RC2 and imported QTI's from 3.2. Worked like a charm!
But images are not showing when test takers take the test. They are visible in the back end.
I get a HTTP ERROR 404: - e.g. when trying to see this image:
https://tao.au.dk/tao/getFileFlysystem.php/5d400e7d0743a/1564482841/db257192e6bd893bff4eeec044a36386/6/f/f/bb7abd4b13c8bb8b68c67f60c7b1e/*/en-US/boy at museum_bred.jpg

The file getFileFlysystem.php is at the expected place.

Any idea what could be wrong?
Best regards,
Jeppe

«1

Comments

  • If you set the system debug is there any more information? Also what version of PHP are you running?

  • I am using PHP 7.3.
    I have debug mode set to true, but I don't get anything in the apache-error-log. In the browser console, I get: "Failed to load resource: the server responded with a status of 404 (Not Found)".
    Should I look somewhere else for the error-information?

  • I looked for the image to find out if it was copied as part of the export/import, and I found it in a subfolder to this new 3.3-installation ("./data/tao/public/6/f/f/bb7abd4b13c8bb8b68c67f60c7b1e/en-US"), so it seems that the images are copied as part of the import (and when I see the image in the backend, it also seems to point to a folder in this installation). It is strange!

  • I tried to replace an image and make a new delivery to see if it was connected to the import, but the same problem appears. So it seems like the problem is viewing of images in general.

    Could this be connected to that this instance has a default en-US-language setting, and testers are da-DK?

    Is it possible to change the default to da-DK? (I tried to do that in the generis-settings-file, but that made all items get an "unknown" name (or something like that), so I changed it back).

  • amyamy
    edited July 31

    Can you downgrade to PHP 7.2 which is the version for this release? And can we get a copy of your .htaccess?

  • Downgrading didn't help (I thought I saw somewhere that php7.3 was the one for this release, but I guess I remembered wrong).
    .htaccess:

    Options +FollowSymLinks
    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    SetEnv HTTP_MOD_REWRITE on
    
    #don't match resources and tests
    RewriteCond %{REQUEST_URI}      !/views/        [NC]
    RewriteCond %{REQUEST_URI}      !/tao/install/  [NC]
    RewriteCond %{REQUEST_URI}  !/tao/getFileFlysystem.php [NC]
    
    #call entry point for url resolving and framework bootstrap
    RewriteRule ^(.*)$ index.php [L]
    
    #required by token based access system
    RewriteCond %{REQUEST_URI} (.*)/tao/getFileFlysystem.php/  [NC]
    RewriteRule ^(.*)$ tao/getFileFlysystem.php [L]
    
    </IfModule>
    

    Thanks for helping me!

  • I managed to set up the debug logger. I get this:

    [2019-07-31 16:23:29] tao.INFO: File 2/0/b/a3cace62d8d8f0718b0d001500eb4/en-US/aee651835d4142e0151c1.jpeg not found {"0":"tao_models_classes_FileNotFoundException","file":"/var/www/tao33/tao/models/classes/websource/BaseWebsource.php","line":112} {"uid":"7ad3669d75a8835759869fea"}

    I also get this:

    [2019-07-31 16:23:29] tao.INFO: File 2/0/b/a3cace62d8d8f0718b0d001500eb4/en-US/tao-user-styles.css not found {"0":"tao_models_classes_FileNotFoundException","file":"/var/www/tao33/tao/models/classes/websource/BaseWebsource.php","line":112} {"uid":"5c4d8130e5c93920f39b0411"}

    I guess it is not relevant to this error? But maybe something I should find a way to remove?

  • I managed to find the file in the file system: data/tao/public/2/0/b/a3cace62d8d8f0718b0d001500eb4/en-US/aee651835d4142e0151c1.jpeg - so I guess the problem is in a path somewhere?

  • Hi Amy,
    Great to see that TAO 3.3 is now released. I am still struggling with this error. By looking a little more into the error messages and the script referred to, BaseWebsource.php, it seems that the two error messages are indeed connected, and that the problem is with a filesystem setting somewhere. I really would appreciate a suggestion on where to look.
    I am using Ubuntu 18.04, apache 2.4.29, php 7.2, and TAO 3.3-RC2.
    Thanks!

  • Cen you try to re-add the image within TAO to the item?

  • Yes. I tried to replace the image with a new one. Now I also tried to create a new item, insert an image from the media gallery, and deliver. Then I created another item, inserted an image that I uploaded, created a new test and delivered.
    It is all the same.
    The problem is with all custom file reads, actually - I also tried to upload a custom stylesheet. It succeded:

    Writting in i15646614561971272/itemContent/en-US/style/custom/battery-matrix.css {"file":"/var/www/tao33/generis/common/oatbox/filesystem/File.php","line":188} {"uid":"df3bc1e5da3

    b07fb3dcf41db"}

    But when it should be read:

    tao.INFO: File style/custom//battery-matrix.css not found {"0":"tao_models_classes_FileNotFoundException","file":"/var/www/tao33/taoItems/models/classes/media/LocalItemSource.php","line":27

    3} {"uid":"52a005acc147613c39b11edd"}

    So the problem is a path somewhere, I think... I just cannot find out where to look...

  • Look in config/generis.conf.php that's where most configuration changes are made.

  • I looked there. The only path I could see as possibly related was FILES_PATH which was just data/. I tried to install tao3.3 locally and there the path was from the root dir, so I tried to change that in my production tao instance (to: /var/www/tao33/data/). But that didn't help. Most of the remaining settings are the same.

    Just to sum up: When seeing the items in preview, they appear just fine with images.
    When seeing them as a test-taker, the images aren't shown, and I get the errors "File **** not found" - both for images and custom css-files. And "Failed to load resource: the server responded with a status of 404 " in the console.

  • I just installed tao in another subdomain on the same server. It worked!
    I looked into the apache-directives - everything was the same. So I guess something is wrong with the install, not with the server.

    So now I need a good advice on how to replace the tao-version at the right subdomain with a clean version - preferably without having to export everything and import again. Is there a simple way to do that?
    Thanks!

  • Okay... Solved. I took a bite of the sour apple, as we say in Danish, and reinstalled and re-imported my items. Now I see the images...
    I guess we will have to live without knowing the reason for this strange behavior...

  • I have been thinking. I started out with php7.3, and later downgraded to 7.2. Maybe the problem was something related to php7.3. So if someone is having the same type of problem, maybe look for problems related to that... I don't know.
    I would like to mark this thread as [Solved] - how do I do that?

  • No need to:)

  • edited October 14

    I am using PHP 7.2.23 and I have the exact same issue. So I don't think its just the PHP version, unless the documentation is incorrect and should say 7.2.0?

    I followed the install guide here.. it all appears to be working so far except for images.

    https://adminguide.taotesting.com/3.3/installation-and-upgrade/centos-redhat-and-fedora

    This is the link to the image it's returning.

    http://10.44.70.10/tao/tao/getFileFlysystem.php/5da3ff38f0500/1571046046/1e9a4e60ac43999c38dc2d4c71ea42d0/a/3/9/ef9f734e300144c0589385602441b/*/en-US/phantom-playbook.png

  • I have PHP 7.2.19 on CentOS 6. Can you be more specific on the error from your logs?

  • Thanks Amy,

    Here are the relevant logs

    [2019-10-21 03:57:28] tao.DEBUG: Retrieving QTI Assessment Test Session 'http://10.47.70.105/tao/tao01.rdf#i15716302472026166'... {"file":"/var/www/html/tao/taoQtiTest/models/classes/runner/QtiRunnerServiceContext.php","line":215} {"uid":"650c80e2d96e2c8fba4484cf"}
    [2019-10-21 03:57:28] tao.DEBUG: QtiTimer: Loaded 96 bytes from state storage {"file":"/var/www/html/tao/taoQtiTest/models/classes/runner/time/QtiTimeStorage.php","line":150} {"uid":"650c80e2d96e2c8fba4484cf"}
    [2019-10-21 03:57:28] tao.DEBUG: QtiTimer: Stored 225 bytes into state storage {"file":"/var/www/html/tao/taoQtiTest/models/classes/runner/time/QtiTimeStorage.php","line":137} {"uid":"650c80e2d96e2c8fba4484cf"}
    **[2019-10-21 03:57:28] tao.INFO: File 5/6/9/21b87ccefafc8e1325e2a229f5382/en-US/animal.jpg not found **{"0":"tao_models_classes_FileNotFoundException","file":"/var/www/html/tao/tao/models/classes/websource/BaseWebsource.php","line":112} {"uid":"4b1b2fc583f2a9cbd5537526"}
    [2019-10-21 03:57:28] tao.INFO: File 5/6/9/21b87ccefafc8e1325e2a229f5382/en-US/style.css not found

  • I've done some more digging. The file it is looking for is located at

    /var/www/html/tao/data/tao/public/5/6/9/21b87ccefafc8e1325e2a229f5382/en-US/animal.jpg

    With the following permissions

    -rw-r--r--. 1 apache apache 123788 Oct 14 05:18 animal.jpg

    The error states

    File 5/6/9/21b87ccefafc8e1325e2a229f5382/en-US/animal.jpg not found

    Could it be some type of relative path issue?

  • Can you also check the permission on the directory?

  • [root@localhost ~]# ls -lrt /var/www/html/tao/data/tao/public/5/6/9/21b87ccefafc8e1325e2a229f5382
    total 0
    drwxr-xr-x. 2 apache apache 41 Oct 14 05:18 en-US

    [root@localhost ~]# ls -lrt /var/www/html/tao
    drwxr-xr-x. 10 apache apache 158 Oct 14 04:41 data

    Some of my folders I noticed are owned by root could this be the issue?

    [root@localhost ~]# ls -lrt /var/www/html/tao
    total 412
    -rw-r--r--. 1 apache apache 1981 Jul 5 03:41 whats-new-in-tao-3.3.md
    drwxr-xr-x. 3 apache apache 23 Jul 5 03:41 tests
    -rw-r--r--. 1 apache apache 2099 Jul 5 03:41 README.md
    -rw-r--r--. 1 apache apache 3851 Jul 5 03:41 phpunit.xml
    -rw-r--r--. 1 apache apache 18027 Jul 5 03:41 LICENSE
    -rwxr-xr-x. 1 apache apache 1092 Jul 5 03:41 index.php
    -rwxr-xr-x. 1 apache apache 18092 Jul 5 03:41 gpl-2.0.txt
    -rwxr-xr-x. 1 apache apache 22962 Jul 5 03:41 fdl-1.3.txt
    -rwxr-xr-x. 1 apache apache 1150 Jul 5 03:41 favicon.ico
    -rw-r--r--. 1 apache apache 936 Jul 5 03:41 docker-compose.yml
    drwxr-xr-x. 4 apache apache 65 Jul 5 03:41 docker
    -rwxr-xr-x. 1 apache apache 151194 Jul 5 03:41 composer.lock
    -rwxr-xr-x. 1 apache apache 2187 Jul 5 03:41 composer.json
    drwxr-xr-x. 6 root root 120 Oct 13 23:42 pciSamples
    drwxr-xr-x. 8 root root 135 Oct 13 23:42 taoBackOffice
    drwxr-xr-x. 12 root root 226 Oct 13 23:42 taoClientDiagnostic
    drwxr-xr-x. 14 root root 265 Oct 13 23:42 taoDeliveryRdf
    drwxr-xr-x. 8 root root 184 Oct 13 23:42 taoCe
    drwxr-xr-x. 9 root root 164 Oct 13 23:42 taoDacSimple
    drwxr-xr-x. 13 root root 252 Oct 13 23:42 taoDelivery
    drwxr-xr-x. 8 root root 165 Oct 13 23:42 taoEventLog
    drwxr-xr-x. 10 root root 215 Oct 13 23:42 funcAcl
    drwxr-xr-x. 9 root root 182 Oct 13 23:42 taoGroups
    drwxr-xr-x. 11 root root 208 Oct 13 23:42 taoItems
    drwxr-xr-x. 13 root root 254 Oct 13 23:42 taoQtiItem
    drwxr-xr-x. 10 root root 181 Oct 13 23:42 qtiItemPci
    drwxr-xr-x. 8 root root 168 Oct 13 23:42 qtiItemPic
    drwxr-xr-x. 12 root root 240 Oct 13 23:42 taoLti
    drwxr-xr-x. 13 root root 253 Oct 13 23:42 ltiDeliveryProvider
    drwxr-xr-x. 9 root root 196 Oct 13 23:42 taoMediaManager
    drwxr-xr-x. 11 root root 204 Oct 13 23:42 taoResultServer
    drwxr-xr-x. 7 root root 171 Oct 13 23:42 taoAltResultStorage
    drwxr-xr-x. 9 root root 200 Oct 13 23:42 taoLtiBasicOutcome
    drwxr-xr-x. 7 root root 148 Oct 13 23:42 taoOutcomeRds
    drwxr-xr-x. 12 root root 242 Oct 13 23:42 taoOutcomeUi
    drwxr-xr-x. 10 root root 194 Oct 13 23:42 taoProctoring
    drwxr-xr-x. 9 root root 179 Oct 13 23:42 taoRevision
    drwxr-xr-x. 10 root root 190 Oct 13 23:42 taoTaskQueue
    drwxr-xr-x. 10 root root 193 Oct 13 23:42 taoTests
    drwxr-xr-x. 13 root root 252 Oct 13 23:42 taoQtiTest
    drwxr-xr-x. 7 root root 154 Oct 13 23:42 taoQtiTestPreviewer
    drwxr-xr-x. 11 root root 204 Oct 13 23:42 taoTestTaker
    drwxr-xr-x. 8 root root 179 Oct 13 23:42 generis
    drwxr-xr-x. 29 root root 4096 Oct 13 23:43 vendor
    -rwxr--r--. 1 root root 2797 Oct 13 23:44 MathJax_Install_TAO_3x.sh
    -rw-r--r--. 1 root root 1671 Oct 13 23:51 tao.1
    drwxrwxrwx. 15 apache apache 4096 Oct 14 00:53 config
    drwxr-xr-x. 10 apache apache 158 Oct 14 04:41 data
    drwxr-xr-x. 2 apache apache 6 Oct 14 06:18 logs
    drwxr-xr-x. 15 apache root 4096 Oct 21 01:24 tao
    -rw-r--r--. 1 apache apache 155592 Oct 21 18:50 debug.log

  • Definitely could be, do chown -R apache:apache /var/www/html/tao

  • Thanks I fixed the permissions, however I am still getting the same issue.

  • Just to be clear, are these images related to the original QTI issue or have been uploaded since?

  • Both. I have tried importing an existing QTI package as well as creating a new item from scratch, uploading a new image and then creating a test that uses that item. I can see the image when 'authoring' the item, but the test user cannot.

  • ok.

    I am having the exact same issue with a new installation on Ubuntu 18.04 with PHP version rsion 'PHP 7.2.19-0ubuntu0.18.04.2'

    It seems to be some weird path issue. Does anyone have any idea why this would be happening.

    Adding to that I noticed that none of the preinstalled 'items' have any content in them.

  • Can you chane the image from jpeg to jgp and also within the item(xml if needed)

Sign In or Register to comment.

We use cookies on our website to support technical features that enhance your user experience. Cookie Policy Privacy Policy

×