Customer Portal

Get Involved. Join the Conversation.

Topic

    Bastiaan van der Kooij
    Assets folder not writable from CP in August 2016?Answered
    Topic posted January 3, 2017 by Bastiaan van der KooijGold Crown: 30,000+ Points 
    444 Views, 12 Comments
    Title:
    Assets folder not writable from CP in August 2016?
    Content:

    I have a script that runs in the Customer Portal that writes stuff to a log in a sub folder of the assets folder. This has been running fine on a Nov 2015 site.However I have ported this script to a August 2016 site, created the sub folder in the assets folder and now suddenly I do not have access anymore.

    When I execute the following command to check if the directory is writable;
    $writable = is_writable('/vhosts/interfacename/euf/assets/log');

    Fatal error: Access to is_writable is denied because its trying to access restricted folders

    Does anyone know if this has been changed and how to make this writable again??

    thanks,
    Bastiaan

    Version:
    Aug2016

    Best Comment

    Willie Eide

    OK. I think I found the source of the issue.

    In 16.8, the OSvC PHP team restricted access to some directories in the new PHP executable for security reasons. These changes were in PHP 5.6.3 and OSvC 16.8. After the release, it was realized that to many directories were shut down and thus were added back in 16.11. There is not mechanism to service pack those changes in 16.8. 

    /euf/assets was one of those directories

    While that is available again in 16.11 I understand that doesn't help you today. You can write to :​

    .[site]/tmp
    ./euf/application/source (and sub directories)
    ./custom 

    to name a few.


     

    Comment

     

    • Scott Harwell

      Hi Bastiaan,

      Haven't heard of any changes that would cause this myself...but certainly a possibility that script access to assets may have changed.

      What kind of script is calling the method (CPM, custom script, CP)?  How was the log folder created; a WebDAV client or the script itself (thereby setting the folder owner)?  If you delete and recreate the folder manually, does it fix the issue?  You might have Customer Care run fixperms on the site, too, as there may be a permissions lapse on the folder.

      If you've tried those items, then reporting the issue to Customer Care is likely the best course of action.

    • Bastiaan van der Kooij

      Hey Scott,

      the script runs in the customer portal, the folder is created in webdav, tried recreating it multiple times (no way of setting chmods in webdav). I cannot create the folder in the script as I run into the same restriction error.

      I have contacted Customer Care, so hopefully they can fix it for me...

      If you hear anything about if this is new policy let me know,

      Bastiaan

    • Dietrik

      I have no problem writing files to the assets folder on new versions. Can you copy files through webdav ? .

    • Bastiaan van der Kooij

      Webdav is no problem, it's only via PHP in the Customer Portal. Was the site you tested a new site created with that version or an older site upgraded to that version?

    • Nisar

      Hi Bastiaan,

      You're probably right. Like you, I used to write/upload stuff to the "assets" folder previously but haven't been able to in recent times. It most likely looks like write permissions have been removed from that folder in the latest versions (An official word on this would be very helpful)

      Reference: http://stackoverflow.com/questions/40929880/upload-file-into-assets-folder-via-move-uploaded-file

    • Willie Eide

      For clarification - you upgraded your OSvC, but did you migrate as well or are you on the same CP version?

    • Willie Eide

      OK. I think I found the source of the issue.

      In 16.8, the OSvC PHP team restricted access to some directories in the new PHP executable for security reasons. These changes were in PHP 5.6.3 and OSvC 16.8. After the release, it was realized that to many directories were shut down and thus were added back in 16.11. There is not mechanism to service pack those changes in 16.8. 

      /euf/assets was one of those directories

      While that is available again in 16.11 I understand that doesn't help you today. You can write to :​

      .[site]/tmp
      ./euf/application/source (and sub directories)
      ./custom 

      to name a few.


       

    • Barrilito van Dijk

      Hi Willie,

      Thank you for your explanation. Indeed I don't think Bastiaan will be happy at this moment with his release, but good to know what the cause of the problem was and to know it is fixed in a newer release.

      To get back on a remark by Nisar, I agree that these kind of things should officially be announced. So I am glad you have joined us here Willie with this explanation, but as it is/was a restriction/change, you would want to read that somewhere in a changelog I guess.

      Thanks Willie!

      Regards

    • Bastiaan van der Kooij

      hey Willie,

      your answer is highly appreciated and takes away the guess work for me!

      I am glad to see that this is reversed in a newer release, so I'll just contact hosting to manually set the permissions for the assets directory.

      Before posting this I went through all the change logs of Customer Portal documentation and did not find anything so like Barrilito I think this should be documented somewhere

      Bastiaan

       

    • Nisar
      Bastiaan van der Kooij said:
      I am glad to see that this is reversed in a newer release, so I'll just contact hosting to manually set the permissions for the assets directory.

       

      View original

      A small query here. Does that mean by contacting the Oracle Support, we can request them to make the said folder writable?

    • Anurag Mittal

      Bastiaan, were you able to get it work by creating a ticket with Oracle support team. 

      I am trying to create logs file in assets folder through CPM and facing same issue as yours.

    • Bastiaan van der Kooij

      hey Anurag,

      I upgraded to the next release and there the issue was fixed

      Bastiaan