Skip to content

Cannot get Represt to work with project where Configuration Management in DNG is enabled #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
denisbelanger101 opened this issue Mar 27, 2025 · 16 comments

Comments

@denisbelanger101
Copy link

denisbelanger101 commented Mar 27, 2025

Hi,

When I use the below strings in a project that has Configuration Management enabled (Opt-in), it never works. Would someone know why it's like that?
represt rm resources -J "https://server" -U username -P password -p "Project" -c Requirements -l "Project Initial Stream" -m "100000-Segment 1.1 VOI" -C "C:\TEMP##aatest\test1.csv"-V

Error message:
(...)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://...
[PYI-37292:ERROR] Failed to execute script 'represt' due to unhandled exception!

Some help would be very appreciated.

Thank you,
Denis

Screenshot to show what is working in my browser and when comparing it to the URL I get from the represt error message.

Image
@barny
Copy link
Member

barny commented Apr 1, 2025

Works for me :-)

From your screenshot it's the OSLC Query to find the module from its name "100000-Segment 1.1 VOI" that's failing, so it's not got as far as using the Reportable REST API.

Try with a different module?

What version of elmclient are you using?

What DOORS Next version and ifix are you using?

@denisbelanger101
Copy link
Author

denisbelanger101 commented Apr 1, 2025

Thank you for your answer, I really appreciate.

The Versions are:

Image Image

The Module name:

Image

I tried it with four different Modules and I still have errors. I renamed the folder elmclient by elmclient-old and I freshly reinstalled it. Still doesn't work.

Is there a deeper debug mode I could enable or a log that I could provide?

Here is the complete error code...


----->NOTE: the editor here does not paste the text as it is... Below is the text and down below is the screenshot of the text...When you paste the text, it is ok, but when you click "Update comment" the text is different...

C:>represt rm resources -J "https://server.clm.ibmcloud.com" -U MyUsername -P password -p "ProjectName" -c Requirements -l "ProjectName Initial Stream" -m "402620-Technoparc" -C "C:\TEMP##aatest\test-new-module1.csv"-V
elmclient.httpops: ERROR Exception on executing request. URL: https://server.clm.ibmcloud.com/rm/views?oslc.pageSize=200&oslc.paging=true&oslc.prefix=dcterms%3D%3Chttp%3A//purl.org/dc/terms/%3E%2Crdm_types%3D%3Chttp%3A//www.ibm.com/xmlns/rdm/types/%3E%2Cjazz_rm%3D%3Chttp%3A//jazz.net/ns/rm%23%3E&oslc.query=true&oslc.select=%2A&oslc.where=dcterms%3Atitle%3D%22402620-Technoparc%22%20and%20rdm_types%3AArtifactFormat%3Djazz_rm%3AModule&projectURL=https%3A//server.clm.ibmcloud.com/rm/process/project-areas/_uErTUHN5Eeq8dvNydv8COA, 400, <rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:err="http://jazz.net/xmlns/prod/jazz/foundation/1.0/">
rdf:Description
<err:detailedMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>GC app is unavailable so we should not be attempting to resolve LCs against GC Application URIs. Submitted GC URI was <https://server.clm.ibmcloud.com/rm/cm/stream/_upLHhnN5Eeq8dvNydv8COA>.</err:detailedMessage>
<err:errorMessage rdf:datatype="http://www.w3.org/2001/XMLSchema#string"
>Bad Request</err:errorMessage>
<err:errorStatus rdf:datatype="http://www.w3.org/2001/XMLSchema#long"
>400</err:errorStatus>
</rdf:Description>
</rdf:RDF>

Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "c:\Users\MyUsername\AppData\Roaming\Python\Python313\Scripts\represt.exe_main
.py", line 7, in
sys.exit(main())
~~~~^^
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\examples\represt.py", line 392, in main
represt_main()
~~~~~~~~~~~~^^
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\examples\represt.py", line 223, in represt_main
queryurl,queryparams,queryheaders = mainapp.process_represt_arguments( args, allapps )
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient_rm.py", line 1567, in process_represt_arguments
modules = queryon.execute_oslc_query(
qcbase,
whereterms=[['dcterms:title','=',f'"{args.module}"'], ['rdm_types:ArtifactFormat','=','jazz_rm:Module']],
select=['*'],
prefixes={rdfxml.RDF_DEFAULT_PREFIX["dcterms"]:'dcterms',rdfxml.RDF_DEFAULT_PREFIX["rdm_types"]:'rdm_types',rdfxml.RDF_DEFAULT_PREFIX["jazz_rm"]:'jazz_rm'})
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\oslcqueryapi.py", line 442, in execute_oslc_query
results = self._execute_vanilla_oslc_query(querycapabilityuri,query_params1, select=select, prefixes=prefixes, show_progress=show_progress, verbose=verbose, maxresults=maxresults, delaybetweenpages=delaybetweenpages, pagesize=pagesize, intent=intent, saverawresults=saverawresults, cacheable=cacheable)
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\oslcqueryapi.py", line 618, in _execute_vanilla_oslc_query
this_result_xml = self.execute_get_rdf_xml(query_url, params=params, headers=headers, cacheable=cacheable, intent=intent)
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\httpops.py", line 171, in execute_get_rdf_xml
response = request.execute( **kwargs )
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\httpops.py", line 408, in execute
return self._execute_request( no_error_log=no_error_log, close=close, **kwargs )
~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\httpops.py", line 417, in _execute_request
result = self._execute_one_request_with_login( no_error_log=no_error_log, close=close, **kwargs)
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\elmclient\httpops.py", line 611, in _execute_one_request_with_login
response.raise_for_status()
~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\MyUsername\AppData\Roaming\Python\Python313\site-packages\requests\models.py", line 1024, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://server.clm.ibmcloud.com/rm/views?oslc.pageSize=200&oslc.paging=true&oslc.prefix=dcterms%3D%3Chttp%3A//purl.org/dc/terms/%3E%2Crdm_types%3D%3Chttp%3A//www.ibm.com/xmlns/rdm/types/%3E%2Cjazz_rm%3D%3Chttp%3A//jazz.net/ns/rm%23%3E&oslc.query=true&oslc.select=%2A&oslc.where=dcterms%3Atitle%3D%22402620-Technoparc%22%20and%20rdm_types%3AArtifactFormat%3Djazz_rm%3AModule&projectURL=https%3A//server.clm.ibmcloud.com/rm/process/project-areas/_uErTUHN5Eeq8dvNydv8COA&oslc_config.context=https%3A%2F%2Fserver.clm.ibmcloud.com%2Frm%2Fcm%2Fstream%2F_upLHhnN5Eeq8dvNydv8COA


SCREENSHOT OF THE TEXT ABOVE....

Image Image

@barny
Copy link
Member

barny commented Apr 1, 2025

Add -L TRACE to the commandline - this will generate a log file in the logs folder which gives the request, header and body of all http requests and responses. I'm interested in what is probably the last operation in the log, the GET on /rm/views - the ones that's failing - what are the headers on the request? Obfuscate server names obviously, mostly interested in header Configuration-Context or vvc.configuration, are these present, what are their values?

Try adding -W to the command, this will clear the cache and force retreiving lastest data.

Also, are you able to use the oslcquery example, does something like this work (doing the same query for the module)?
oslcquery -J "https://server" -U username -P password -p "Project" -C Requirements -F "Project Initial Stream" -q "dcterms:title=""100000-Segment 1.1 VOI""" -V -W

@barny
Copy link
Member

barny commented Apr 1, 2025

I think this might be something I've fixed indirectly - just updated to version 0,29.0 please try that from pypi and hopefully it will work.

@denisbelanger101
Copy link
Author

denisbelanger101 commented Apr 1, 2025

Ok, I tried 0,29.0. Result is the same. I added -W and -L TRACE , the log is attached here.

elmclient-20250401-144612 - obfuscated.log

For the oslcquery , here is the output screenshot:

Image

Here is the output in an opt-out (CM disabled) project, it works.

Image

I also found this on the web, An old case but that generated similar error messages involving config context...
https://www.ibm.com/mysupport/s/defect/aCI3p000000Cwka/dt208104?language=pt_BR

@barny
Copy link
Member

barny commented Apr 3, 2025

Did you try the oslcquery command?

@denisbelanger101
Copy link
Author

denisbelanger101 commented Apr 3, 2025

Yes, as stated above. The big screenshot is the output of the error generated after the oslcquery line was sent.

I also tried it on my home PC. Fresh installation of Python and elmclient. The error message is the same and the header in the log is the same as in the above log.

@denisbelanger101
Copy link
Author

denisbelanger101 commented Apr 3, 2025

Also, I will start a new comment for this before it's a new finding....

In DOORS NEXT, when I choose to see all My Projects, I see the two projects. the Demo project is the one that works and exports to the csv file. The other one, which has its name hidden with the yellow box, is the one that's not working. This one has a component...When I click on Show Component, I get the other window below that says that a component name called "Requirements" exists. I think there is something missing to go one level deeper inside that component to get the Modules. But how do we do this? In the URL of my open DNG there is this string: "&componentURI=https://server.com/rm/rm-projects/_uErTUHN5Eeq8dvNydv8COA/components/_upG2EHN5Eeq8dvNydv8COA" the project area is at the beginning as you can see, then there is a sub-level named "Component" would that be the issue?
In the command I have a parameter "-c Requirements" but it's like the code does not see it...or I use it wrongly...

Image

Image

@denisbelanger101
Copy link
Author

Another finding: In the get HTTP URL, the Module URI is not there, only the literal title:
In the whole log file, the URI of the Module is not found...

The Module name is: 402620-Technoparc

The Module URI is: MD_C1L58Bo8Eeylw979BSgNIA

Shouldn't the module be called by its URI instead of the literal form?

@denisbelanger101
Copy link
Author

I also redo the test for OSLCquery. The comand I used was this one:

oslcquery -J " https://Server.ibmcloud.com" -U Username -P Password -p "Project" -C "Requirements" -F "Project Initial Stream" -q "dcterms:title="402620-Technoparc"" -V -W -L DEBUG

It still didn't work but the data in the log is different.

The output window data is below and the debug log attached.


Image

elmclient-20250403-144307 - obfuscated.log

@denisbelanger101
Copy link
Author

Hi,

I tried everything I could think of, but still doesn't work. It works only with OPT-OUT project not when in a OPT-IN project.
For the OPT-IN project, nothing works and all the logs are above. It is really unfortunate because it looks like there was a lot of energy put in this code project, and to see it not working is really sad. These functionalities would be so much useful.

Regards,
Denis Belanger

@barny
Copy link
Member

barny commented Apr 15, 2025

Hi Denis

I use oslcquery all the time on opt-in projects, so I don't think that's the issue. represt I don't use much, but AFAICT it works with opt-in.

I'll have to review what you provided, hopefully I can figure out the problem.

Does the project have archived configurations or components?

Regards
Ian

@denisbelanger101
Copy link
Author

denisbelanger101 commented Apr 15, 2025

Hi Ian,

There are no archived configurations or components. Tell me, are there any calls in this code that would require me to have an admin role in DNG?

Thank you,
Denis

@denisbelanger101
Copy link
Author

Good morning Ian,

Did you have time to look at what could be the issue?

Thank you!
Denis

@denisbelanger101
Copy link
Author

Hi Ian,

I know this is a collaborative project and that it is worked on only when people have time to do so. If you don't have time to look at the issue, would there be someone else that could look at it?

I have put more details on the issue to extract a Module from our DNG to csv. If someone can look at it , I would really really appreciate it!

Thank you,
Denis

@denisbelanger101
Copy link
Author

Hi,

Here are a couple of things more that we did. We created a new project, opt-in, in which I have fill admin access rights, and I tried to export a module using the same command string and it still doesn't work. From this point, we will stop working on this. We have thousands of users around the world that use DNG and they will not be able to enjoy all this work. That's so unfortunate.

Thanks,
Denis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants