- %APPDATA%\MathWorks\MATLAB\R2023b\Polyspace (for Windows)
- $home/.matlab/R2023b/Polyspace (for Linux)
- $home/Library/Application Support/MathWorks/MATLAB (for mac)
Why do I receive the error regarding "polyspace.connector.Service" when using the report generator?
45 views (last 30 days)
Show older comments
MathWorks Support Team
on 9 Nov 2021
Edited: MathWorks Support Team
on 28 Apr 2025
While trying report generation, the following error is thrown:
Location: null, user name: xxxxxxxxx,
id: xxx@xxxxxxx, print mode: false Polyspace Report Generator Loading results Error: matlab.internal.webservices.HTTPConnector/copyContentToByteArray (Line 373)
The server returned the status 503 with message "Service Unavailable" in response to the request to URL URL http://localhost:9254/metadata.
However, if I run the analysis and then generate a report, the following message is thrown:
error: polyspace.connector.Service/nGetPort (line 198)
No available ports found in the range 9093-10093
error: polyspace.connector.Service (line 88)
error: polyspace.connector.Query (line 37)
error: PolySpaceResult/Query (line 400)
error: PolySpaceResult/GetResultProperties (line 607)
error: PolySpaceResult/Initialise (line 471)
error: PolySpaceResult (line 103)
error: PolySpaceResultInterface (line 279)
error: polyspace_report_internal (line 174)
error: psrptgenprivate (line 19)
error: polyspace_report (line 7)
polyspace:pscore:noPortForConnectorError
**********************************************************
***
*** Report generation done
***
**********************************************************
Accepted Answer
MathWorks Support Team
on 28 Apr 2025
Edited: MathWorks Support Team
on 28 Apr 2025
The problem is probably cause by a component called the connector.
Hence, here is the procedure to debug this connector.
1. Check the port used by the connector
The port used by the connector appears in the message:
The server returned the status 503 with message "Service Unavailable" in response to the request to URL URL http://localhost:9254/metadata
To check this port, the command Telnet or any command that allows verifying that a separate process can open the port that the polyspace-connector is using, can be used.
For example under Linux, in a bash console, launch this command (replace 9091 with the actual port number the connector is using):
(echo >/dev/tcp/localhost/9091) &>/dev/null && echo "open" || echo "close"
If the port is not open then you need to find out why it is not accessible - a firewall or http proxy could be preventing communication between the two processes.
Check that the connector is reachable
Polyspace-connector is reached through a TCP port 9090 to 10100. A proxy or a firewall may block communication with the connector from Polyspace UI or from Polyspace Report Generator. Please check the network settings, especially the proxy server, this can be a root cause of the behavior.
To check if the connector is reachable, open a shell window on the machine where the connector is supposed to be running and execute:
<polyspaceroot>/polyspace/bin/polyspace-connector
This command returns a URL similar to
Upstream target http://127.0.0.1:9093
Then, in another Shell window, type
curl http://127.0.0.1:9093/metadata
You will get a successful status like:
{"status":{"statusCode":"SUCCESS","message":"Succeeded","sqlDuration":-1,"computeDuration":35},"payload":{"Release":"R2023a Update 6", ...
or a Connection refused:
curl: (7) Failed to connect to 127.0.0.1 port 9093: Connection refused
Debugging the connector
Here is the procedure to create a dump file:
Before R2025a:
Create a file named connector.properties with the following line:
application.debug=true
You can add the line
application.debug.console=true
if you need to have a console window, for example with PolyspaceAsYouCode.
If you want to debug the connector in the context of the Report Generator, copy this file into the Polyspace preferences folder:
Please adapt the version number to the version you are using.
For PolyspaceAsYouCode, copy it to the working folder of the project.
Re-run the same command to reproduce the issue. When the command is done, two dump files will be created into the preferences folder (above):
1) dmp_%number%@%pc_name%.txt
2) connectorj4eva_log_%id%.txt
Please send us these two files (the most recent ones if there are many) to the MathWorks Technical Support.
After R2025a:
Create a file named connector_driver.json in %APPDATA%\MathWorks\MATLAB\R<version>\Polyspace
In that file add:
{
"debug": true,
"reverseproxy": true
}
Send us the console log as well as the log file generated thanks to the debug mode: %APPDATA%\MathWorks\MATLAB\R<version>\Polyspace\polyspace_connector_log_<PID>.txt
0 Comments
More Answers (0)
See Also
Categories
Find more on Run Settings in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!