Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Issue with file upload to the DM cloud using PowerShell and EPM Automate

M_SladicJan 18 2019 — edited Jan 21 2019

In the previous discussion (see https://community.oracle.com/message/15041126#15041126) I explained my problem trying to upload the file from our server onto EPBCS DM location using PowerShell and REST. Today I tried to do the same using EPM Automate instead of REST, still from within PowerShell.

So, here is the test code, within the PowerShell script, I tried:

    $EpmAutomatePath = "E:\App\Oracle\EPM Automate\bin\epmautomate.bat"

    $PWD_File = "E:\Batches\credentials\pwd.epw"

    #$uploaddir= "inbox\CANRptg_ACT\"

    $uploaddir= "inbox\repository"

    $dimProductFileFull = "e:\test\rejects.txt"

    & "$EpmAutomatePath" "login" $unameHC $PWD_File $appLink $domain

    #1#& "$EpmAutomatePath" uploadfile & "$dimProductFileFull" $uploaddir.replace("\","/")

    #2#& "$EpmAutomatePath" "uploadfile" "$dimProductFileFull".replace("\","/") $uploaddir.replace("\","/")

    & "$EpmAutomatePath" uploadfile "e:/test/1586_rejProduct.txt" inbox/repository

    & "$EpmAutomatePath" "logout"

    exit

The LOGIN and LOGOUT parts work fine. But, the UPLOAD again gives problems. You can see that I tried to call the function with variables, and different combinations of quotes (as in many blogs and Oracle documentation I read in the last few hours), and lastly tried with hardcoded values (the original $dimProductFileFull has a path with the space in it, thus in quotes). But after waiting some 10 min, this is what comes in the P/Shell ISE console:

     [DBG]: PS C:\Users\<user>>>

     Login successful

    

     Note: A new version of EPM Automate is available. You can use "upgrade" command to install.

     [DBG]: PS C:\Users\<user>>>

     Processing...

    

     EPMAT-11:Internal server error. Retry failed

     logout completed successfully

So when I added the debug flag (-d) running the same EPMAutomate call from Command Prompt, I got this output in its log:

....

2019/01/18 19:34:55:869 EST [DEBUG] HttpConnection - Connection is stale, closing...

2019/01/18 19:34:55:869 EST [DEBUG] HttpConnection - Open connection to <server>:443

2019/01/18 19:34:55:900 EST [DEBUG] header - >> "POST /interop/rest/v1/applicationsnapshots/rejects.zip/contents?q=%7B%22isFirst%22%3Atrue%2C%22chunkSize%22%3A14%2C%22fileSize%22%3A%22339%22%2C%22isLast%22%3Afalse%2C%22extDirPath%22%3A%22inbox%2Frepository%22%7D HTTP/1.1[\r][\n]"

2019/01/18 19:34:55:900 EST [DEBUG] HttpMethodBase - Adding Host request header

2019/01/18 19:34:55:900 EST [DEBUG] header - >> "Authorization: Basic ************************************[\r][\n]"

2019/01/18 19:34:55:900 EST [DEBUG] header - >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"

2019/01/18 19:34:55:900 EST [DEBUG] header - >> "Host: <server>[\r][\n]"

2019/01/18 19:34:55:900 EST [DEBUG] header - >> "Content-Length: 14[\r][\n]"

2019/01/18 19:34:55:900 EST [DEBUG] header - >> "[\r][\n]"

2019/01/18 19:34:56:010 EST [DEBUG] EntityEnclosingMethod - Request body sent

2019/01/18 19:34:56:057 EST [DEBUG] header - << "HTTP/1.1 401 Authorization Required[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "HTTP/1.1 401 Authorization Required[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "Date: Fri, 18 Jan 2019 20:35:30 GMT[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "Server: Oracle-Application-Server-11g[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "WWW-Authenticate: Basic realm="MTLDAP_BasicSessionLess"[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "Content-Length: 294[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "Content-Type: text/html; charset=iso-8859-1[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "Strict-Transport-Security: max-age=31536000 ; includeSubDomains[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] header - << "[\r][\n]"

2019/01/18 19:34:56:057 EST [DEBUG] HttpMethodDirector - Authorization required

2019/01/18 19:34:56:057 EST [DEBUG] AuthChallengeProcessor - Supported authentication schemes in the order of preference: [NTLM, Digest, Basic]

2019/01/18 19:34:56:057 EST [DEBUG] AuthChallengeProcessor - Challenge for NTLM authentication scheme not available

2019/01/18 19:34:56:057 EST [DEBUG] AuthChallengeProcessor - Challenge for Digest authentication scheme not available

2019/01/18 19:34:56:057 EST [INFO] AuthChallengeProcessor - Basic authentication scheme selected

2019/01/18 19:34:56:057 EST [DEBUG] AuthChallengeProcessor - Using authentication scheme: basic

2019/01/18 19:34:56:057 EST [DEBUG] AuthChallengeProcessor - Authorization challenge processed

2019/01/18 19:34:56:057 EST [DEBUG] HttpMethodDirector - Authentication scope: BASIC 'MTLDAP_BasicSessionLess'@<server>:443

2019/01/18 19:34:56:057 EST [DEBUG] HttpMethodDirector - Credentials required

2019/01/18 19:34:56:057 EST [DEBUG] HttpMethodDirector - Credentials provider not available

2019/01/18 19:34:56:057 EST [INFO] HttpMethodDirector - No credentials available for BASIC 'MTLDAP_BasicSessionLess'@<server>:443

2019/01/18 19:34:56:057 EST [DEBUG] HttpMethodBase - Resorting to protocol version default close connection policy

2019/01/18 19:34:56:057 EST [DEBUG] HttpMethodBase - Should NOT close connection, using HTTP/1.1

2019/01/18 19:34:56:057 EST [DEBUG] HttpConnection - Releasing connection back to connection manager.

2019/01/18 19:34:56:057 EST [DEBUG] MultiThreadedHttpConnectionManager - Freeing connection, hostConfig=HostConfiguration[host=https://<server>]

2019/01/18 19:34:56:057 EST [DEBUG] IdleConnectionHandler - Adding connection at: 1547858096057

2019/01/18 19:34:56:057 EST [DEBUG] MultiThreadedHttpConnectionManager - Notifying no-one, there are no waiting threads

Status Code: 401 and response: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><html><head><title>401 Authorization Required</title></head><body><h1>Authorization Required</h1><p>You are not authorized to access the requested resource.  Check the supplied credentials (e.g., username and password).</p></body></html>

CustomRetryHandler : retry for the url /interop/rest/v1/applicationsnapshots/rejects.zip/contents retryFlag is FALSE and retry count is 9

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

Exception in com.hyperion.epmctl.client.processaction.actions.MultiUpload, Method: SendData

EPMAT-11:Internal server error. Retry failed

Exit Method processRequest of class com.hyperion.epmctl.client.processaction.actions.MultiUpload

EPMAT-11:Internal server error. Retry failed

I am not sure I am reading it right, but it says something about authorization, yet I log successfully in the first EPM Automate call line, just above the upload one. In several blogs I read (I used EPMMarshall's backup blog article as a starting point, no one is doing anything differently - or so it looks like to me, cause their scripts work.

Any help appreciated.

Thanks,

Milos

Comments