Forum Discussion

kgroneman's avatar
6 years ago

Script no longer works. Auth problem - Help

I'm not a developer but thought this would be a good place to ask.  I have a script that uses Ruby and Curl to move messages from one node to another.  The script worked perfectly on my Windows 7 machine.  I had to re-image the machine with Windows 10 and now the script doesn't work.  It appears to have an authentication problem even though I use an authenticated LiSESSIONID.

Here's what I have:

  • Both Ruby and Curl are in my windows path
  • I'm running the script exactly as I did in Windows 7
  • move-messages.rb is the name of the script

Here's an example of how it's run. 

  • The input file consists of message IDs in column 1, "move" in column 2, and the destination node ID in column 3
  • The command line consists of: 
    • ruby move-messages.rb -h
    • URL of the community -s
    • My logged in session ID
    • Input file
    • Output log file
  • EXAMPLE:  ruby move-messages.rb -h https://community.softwaregrp.com -s 418CD9CBE6FECAEC9EED17124649ADBB Testing\Test_Move1.csv > Testing\Test_Move2.log

A log after a successful run looks like this:

I, [2018-09-25T08:59:35.697787 #12800] INFO -- : STARTING THE PROCESS
I, [2018-09-25T08:59:35.698787 #12800] INFO -- : INSTANCE: https://community.softwaregrp.com
I, [2018-09-25T08:59:35.699787 #12800] INFO -- : SESSIONID: 238D4AA2252A5E887341E0526E7E1010
I, [2018-09-25T08:59:35.699787 #12800] INFO -- : SOURCE FILE: Testing\workingfile.csv
I, [2018-09-25T08:59:36.088826 #12800] INFO -- : Authentication success.
I, [2018-09-25T08:59:36.091826 #12800] INFO -- : line: 1, topic '1666437': move 'Management'
I, [2018-09-25T08:59:38.803097 #12800] INFO -- : Moved 1666437 to Management.
I, [2018-09-25T08:59:38.805098 #12800] INFO -- : line: 2, topic '1658215': move 'Management'
I, [2018-09-25T08:59:41.565374 #12800] INFO -- : Moved 1658215 to Management.I, [2018-09-25T09:00:26.564873 #12800] INFO -- : 51 seconds elapsed
I, [2018-09-25T09:00:26.565873 #12800] INFO -- : 2 seconds per item
I, [2018-09-25T09:00:26.566873 #12800] INFO -- : TOTAL OF 19 ACTIONS PERFORMED, 0 ERRORS ENCOUNTERED.
I, [2018-09-25T09:00:26.567873 #12800] INFO -- : THE PROCESS TOOK 00:00:50 HOURS.
I, [2018-09-25T09:00:26.568873 #12800] INFO -- : PROCESS COMPLETED.

After moving to Win 10, my logs look like this:

I, [2019-08-14T14:18:51.136906 #19004] INFO -- : STARTING THE PROCESS
I, [2019-08-14T14:18:51.137541 #19004] INFO -- : INSTANCE: https://community.microfocus.com
I, [2019-08-14T14:18:51.137770 #19004] INFO -- : SESSIONID: 40732A7C3D3FCE9B78BB57536AB861BE
I, [2019-08-14T14:18:51.137937 #19004] INFO -- : SOURCE FILE: StarTeamSDKDiscussions\finished.csv
I, [2019-08-14T14:18:51.469950 #19004] INFO -- : WARN: REST call failed.
I, [2019-08-14T14:18:51.471151 #19004] INFO -- : WARN: REST response:
<response status="error">
<error code="303">
<message>
User -1 does not have the following permission(s) at dcvta86296: [ allow_restapi_call_read ]
</message>
</error>
</response>

It appears to me as if the session ID isn't being recognized.

Can someone point out to me whatever my stupid user error is?  I'd sure appreciate it. 

BTW, if I can get this to work again, it's a great way to move a lot of posts from one node to another.  It's also easily reversible if something goes wrong by switching the source/destination.  

    • kgroneman's avatar
      kgroneman
      Boss

      Thanks Parshant , that's just because old example I selected was before we changed our domain name.  My bad.    community.softwaregrp.com now redirects to community.microfocus.com and I did run some instances on my Win7 OS after the change that worked so that's probably not the issue. 

      EDIT:   I looked at some of the more recent run logs and they do list it as softwaregrp.com so I'll look more closely at that and see why it's different.   

      2nd EDIT:  Nope.  I found a run previous to my OS move that uses the microfocus.com domain and it worked:

      I, [2019-05-14T13:49:53.623195 #14628]  INFO -- : STARTING THE PROCESS
      I, [2019-05-14T13:49:53.623195 #14628]  INFO -- :    INSTANCE: <a href="https://community.microfocus.com" target="_blank">https://community.microfocus.com</a>
      I, [2019-05-14T13:49:53.624195 #14628]  INFO -- :   SESSIONID: 38C778CF132D39FF53B10439FA07A4A9
      I, [2019-05-14T13:49:53.624195 #14628]  INFO -- : SOURCE FILE: ITSMblog/finished.csv
      I, [2019-05-14T13:49:54.571290 #14628]  INFO -- : Authentication success.
      • Parshant's avatar
        Parshant
        Boss

        Can you check the file structure of your working files is same on both of the OS.

        Looks like session id not created during the process run. Which results in failure.