ATutor

Learning Management Tools







Pages:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15


Content Import Failed in 151 build 20050803


  • 2005-08-04 06:12:43

    Content Import Failed in 151 build 20050803

    If you are asking for help, provide lots of detail so problems can be reproduced.

    Things to describe:
    operating system - Linux s2.4.20-18.7
    version of ATutor - 1.5.1 Nightly 2005 08 03
    versions of php - 4.4.1-dev
    version of mysq l - 3.23.56
    webserver & version - Apache 10327100
    copies of error messages - Import Failed
    changes to default settings - NIL
    web browser being used - IE6
    and anything else relevant -

    Was trying to install ATutor for the first time and import test content, the error indicating the import failed.

    Tried upload with filemanager with the same packages and files can be uploaded without problem. So upload and file size limit is not a problem.

    Extracting zip file from filemanager also works fine so it's not a zip problem.

    content directory permission is set to 777.

    Tried exporting sample course and import in the exported course encounter same problem.

    Is there any way we can get a more descriptive error message to identify the problem?

  • 2005-08-04 10:34:31

    .

    attach the content package to a post so we can try it.

  • 2005-08-05 04:53:15

    Import Failed! with Content Package

    Personally I don\'t think it\'s a package problem but rather somewhere the configure server trigger off this issue.

    In anycase, I have attached a few packages that have the problem.

    If I can get a more detail message, instead of just the \'Import Failed!\', probably I can try to figure out the cause.

  • 2005-08-05 04:57:38

    Import Failed! with Content Package

    Another package for your testing.

  • 2005-08-05 08:08:49

    Recursively writable

    Both packages import fine.

    permissions on the content directory should be

    chmod -R 777 (must have the -R switch)

    but preferable

    chmod a+rwx

    The content directory has to be recursively writable.

    [reply][b]In reply to:[/b]
    Another package for your testing.
    [op]forums/view.php?fid=7;pid=5342;page=1#5356[/op][/reply]

  • 2005-08-07 05:09:56

    Recursive writable

    During the initial set up, I have already set the content directory to 777, as well as subdirectories.

    That's described when I post the problem.

    I don't think it's the package problem but rather somewhere there is some configuration that ATutor doesn't like.

  • 2005-08-07 07:52:26

    Install again

    Install ATutor again, but use a+rwx instead of 777 to set the permission on the content/ directory.

    chmod a+rwx content/

    Using 777 is incorrect.

  • 2005-08-08 06:12:18

    Re-installed and set a+rwx, still failed

    I re-installed ATutor and set the content directory via chmod a+rwx content/

    Import again and still getting the Import Failed message.

    The upload of the packages seems to be fine as I can see the updload temporary file created in the /tmp directory.

    Attached is a directory list of the content directory for your reference.

  • 2005-08-08 06:13:28

    The directory listing - re-attached

    Didn't set the directory listing to Public. Here is the file...

  • 2005-08-09 08:50:11

    setuid bit "s"

    The setuid bit has been set, which may be affecting the creation of files on your system. The "s" in the directory permission.

    You could try to unset it using:
    chmod -R a-s content/

    If you are on a hosted system, you may need to contact your service provider to have the bit removed.

    The permissions on the subdirectories should be:
    drwxr-xr-x
    rather than
    drwxrwsrwx

    Permissions on the content/ directory itself should be
    drwxrwxrwx

    Info on directory permissions
    http://www.greenend.org.uk/rjk/2004/perms.html

  • 2005-08-10 02:18:33

    chmod -R a-s content/ done, still failed

    Really appreciate the support given so far but still no go. I have done a chmod -R a-s content/ and has double check and it's still no go. Same error message.

    Anyway I can modify the relevant code to display more detail php related messages? I still believe it's some specific server setup that cause this issues.

    I'm installing this on a distribution from http://contibs.org
    which is based on redhat 7.3, but the PHP and MySQL has been upgraded to the required version for ATutor.

    Many thanks again for the great support and really keen to get this resolved.

  • 2005-08-10 08:11:31

    Who own the web server

    Check to make sure the webserver is owned bythe "www" users. or add the www user to the webserver group. Usually this user:group is nobody:nobody.

    [reply][b]In reply to:[/b]
    Really appreciate the support given so far but still no go. I have done a chmod -R a-s content/ and has double check and it's still no go. Same error message.

    Anyway I can modify the relevant code...
    [op]forums/view.php?fid=7;pid=5342;page=1#5405[/op][/reply]

  • 2005-08-10 20:51:13

    confirmed Apache using user www

    Yes. I have confirmed that Apache is using user www.

    A quick check, I was browing through the table AT_content and found that the two courses created for the testing, the field Content_Path is blank. Can this be the reason??

  • 2005-08-11 08:01:32

    no more suggestions

    Content_Path contains a path to a content package. It has no affect of content otherwise.

    I have no other suggestions, other than try installing on a different system.

  • 2005-08-13 05:46:10

    Did a bit for tracing and this is what I have found...

    Not giving up yet..

    Did a bit of tracing with the codes and the execution failed at the extract code using PclZip:
    ...
    /* extract the entire archive into AT_COURSE_CONTENT . import/$course using the call back function to filter out php files */
    error_reporting(0);

    echo $_FILES['file']['tmp_name'];

    $archive = new PclZip($_FILES['file']['tmp_name']);

    if ($archive->extract( PCLZIP_OPT_PATH, $import_path,
    PCLZIP_CB_PRE_EXTRACT, 'preImportCallBack') == 0) {
    $msg->addError('IMPORT_FAILED');
    // echo 'Error : '.$archive->errorInfo(true);
    clr_dir($import_path);
    header('Location: index.php');
    exit;
    }
    error_reporting(E_ALL ^ E_NOTICE);
    ....
    Comment out the echo 'Error : '.$archive->errorInfo(true); statement and have this message:

    Error : PCLZIP_ERR_MISSING_FILE (-4) : Missing archive file '/tmp/phpJcRpnz'

    Further check on the /tmp directory found that during uploading, the temp file is indeed created but was immediately removed once uploaded. Hence resulted in the above message.

    Anything in PHP.ini that can be the cause of this?

  • 2005-08-14 02:33:03

    Weekend effort and it's working now with code modification

    Finally, the weekend hours pay off. Managed to get the import working.

    For some reason, by the time the PCLZIP get called, the temporary file was removed. What I have added is a move_uploaded_file() call to move the uploaded file into a specific directory before the PCLZIP extract call and point the zip file to the new directory.

    Now I'm able to import in the course content.

    Not too sure this is a bug, or just something unique in my environment.

    Thanks for the help anyway.

  • 2005-08-16 09:53:50

    .

    try increasing your max upload size and max post size in php.ini

  • 2005-08-16 10:39:11

    Already set to 10MB

    The max upload size and post size has already been set to 10MB.

    Interesting is module such as FileManager seems to be fine even though the code is pretty much the same except for the PCLZIP call.

    Glad that I have resolved it just that I have to remember my modification so that I can patch up in next ATutor upgrade. :)