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.