Skip to content
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

sonar-config projects : Project key 'xxxx:xxxx.xxxx' not found #1509

Open
Jay-jakwak4 opened this issue Nov 18, 2024 · 4 comments
Open

sonar-config projects : Project key 'xxxx:xxxx.xxxx' not found #1509

Jay-jakwak4 opened this issue Nov 18, 2024 · 4 comments

Comments

@Jay-jakwak4
Copy link

Hi Team

If there is no project when importing sonar-config, an error occurs.
If the project does not exist, is it possible to create a new one and import it?

2024-11-18 18:15:58,176 | sonar-config | INFO    | MainThread      | Importing project key 'xxxx:xxxx.xxxx'
2024-11-18 18:15:58,283 | sonar-config | ERROR   | MainThread      | Project key 'xxxx:xxxx.xxxx' not found
2024-11-18 18:16:08,353 | sonar-config | ERROR   | MainThread      | HTTPSConnectionPool(host='sonarqube-secondary.xxx.net', port=443): Read timed out. (read timeout=10) while
2024-11-18 18:16:08,353 | sonar-config | ERROR   | MainThread      | HTTPSConnectionPool(host='sonarqube-secondary.xxx.net', port=443): Read timed out. (read timeout=10) while creating project 'xxx:xxx.xxx'
Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/projects.py", line 1604, in import_config
    o = Project.get_object(endpoint, key)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/projects.py", line 170, in get_object
    raise exceptions.ObjectNotFound(key, f"Project key '{key}' not found")
sonar.exceptions.ObjectNotFound: ERROR 5: Project key 'xxx:xxx.xxx' not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/connectionpool.py", line 536, in _make_request
    response = conn.getresponse()
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/connection.py", line 507, in getresponse
    httplib_response = super().getresponse()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 1349, in getresponse
    response.begin()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 316, in begin
    version, status, reason = self._read_status()
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/http/client.py", line 277, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/socket.py", line 704, in readinto
    return self._sock.recv_into(b)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py", line 1241, in recv_into
    return self.read(nbytes, buffer)
  File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/ssl.py", line 1099, in read
    return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/connectionpool.py", line 843, in urlopen
    retries = retries.increment(
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/util/retry.py", line 474, in increment
    raise reraise(type(error), error, _stacktrace)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/util/util.py", line 39, in reraise
    raise value
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/connectionpool.py", line 789, in urlopen
    response = self._make_request(
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/connectionpool.py", line 538, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/urllib3/connectionpool.py", line 369, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='sonarqube-secondary.xxx.net', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.9/bin/sonar-config", line 8, in <module>
    sys.exit(main())
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/cli/config.py", line 283, in main
    __import_config(endpoint, what, **kwargs)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/cli/config.py", line 250, in __import_config
    func(endpoint, data, key_list=key_list)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/projects.py", line 1607, in import_config
    o = Project.create(endpoint, key, data["name"])
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/projects.py", line 209, in create
    util.handle_error(e, f"creating project '{key}'", catch_http_errors=(HTTPStatus.BAD_REQUEST,))
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/utilities.py", line 491, in handle_error
    raise e
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/projects.py", line 207, in create
    endpoint.post(_CREATE_API, params={"project": key, "name": name})
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/platform.py", line 213, in post
    return self.__run_request(requests.post, api, params, data, mute, **kwargs)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/platform.py", line 298, in __run_request
    util.handle_error(e, "")
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/utilities.py", line 491, in handle_error
    raise e
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/sonar/platform.py", line 279, in __run_request
    r = request(
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/Users/jakwak4/Library/Python/3.9/lib/python/site-packages/requests/adapters.py", line 713, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='sonarqube-secondary.xxx.net', port=443): Read timed out. (read timeout=10)
❯

sonar-tools version : 3.6

Thanks

@okorach
Copy link
Owner

okorach commented Nov 23, 2024

Hi @Jay-jakwak4,

Project creation on the fly is a bit touchy and requires significant work to do it well. This will be added in a future release

@Jay-jakwak4
Copy link
Author

Jay-jakwak4 commented Nov 25, 2024

Hi @okorach
If so, is it possible to treat this as a warning and move forward until future release?
The import could not complete because sonar-config was terminated.
Thanks

@okorach okorach added this to the 3.8 milestone Nov 27, 2024
@okorach
Copy link
Owner

okorach commented Jan 9, 2025

Hi @Jay-jakwak4 ,

This issue should be fixed in the upcoming release 3.8. Once released, let me know if that work in your environment

@Jay-jakwak4
Copy link
Author

Hi @okorach

I tested it on 3.8, but it still doesn't seem to work

2025-01-13 13:46:57,874 | sonar-config | INFO    | MainThread      | Importing project key 'xxxxxx:sxauth-spi.all'
2025-01-13 13:46:57,977 | sonar-config | ERROR   | MainThread      | Project key 'xxxxxx:sxauth-spi.all' not found
^@2025-01-13 13:47:08,058 | sonar-config | ERROR   | MainThread      | HTTPSConnectionPool(host='xxxxx-sonarqube-secondary.xxxxxxx.net', port=443): Read timed out. (read timeout=10) while
2025-01-13 13:47:08,058 | sonar-config | ERROR   | MainThread      | HTTPSConnectionPool(host='xxxxx-sonarqube-secondary.xxxxxxx.net', port=443): Read timed out. (read timeout=10) while creating project 'xxxxxx:sxauth-spi.all'
Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/projects.py", line 1686, in import_config
    o = Project.get_object(endpoint, key)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/projects.py", line 177, in get_object
    raise exceptions.ObjectNotFound(key, f"Project key '{key}' not found")
sonar.exceptions.ObjectNotFound: ERROR 5: Project key 'xxxxxx:sxauth-spi.all' not found

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/connectionpool.py", line 534, in _make_request
    response = conn.getresponse()
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/connection.py", line 516, in getresponse
    httplib_response = super().getresponse()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1368, in getresponse
    response.begin()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 317, in begin
    version, status, reason = self._read_status()
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 278, in _read_status
    line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/socket.py", line 705, in readinto
    return self._sock.recv_into(b)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1273, in recv_into
    return self.read(nbytes, buffer)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1129, in read
    return self._sslobj.read(len, buffer)
TimeoutError: The read operation timed out

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/requests/adapters.py", line 667, in send
    resp = conn.urlopen(
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/connectionpool.py", line 841, in urlopen
    retries = retries.increment(
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/util/retry.py", line 474, in increment
    raise reraise(type(error), error, _stacktrace)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/util/util.py", line 39, in reraise
    raise value
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/connectionpool.py", line 787, in urlopen
    response = self._make_request(
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/connectionpool.py", line 536, in _make_request
    self._raise_timeout(err=e, url=url, timeout_value=read_timeout)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/urllib3/connectionpool.py", line 367, in _raise_timeout
    raise ReadTimeoutError(
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='xxxxx-sonarqube-secondary.xxxxxxx.net', port=443): Read timed out. (read timeout=10)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/jakwak4/Library/Python/3.10/bin/sonar-config", line 8, in <module>
    sys.exit(main())
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/cli/config.py", line 279, in main
    __import_config(endpoint, what, **kwargs)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/cli/config.py", line 246, in __import_config
    func(endpoint, data, key_list=key_list)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/projects.py", line 1689, in import_config
    o = Project.create(endpoint, key, data["name"])
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/projects.py", line 216, in create
    util.handle_error(e, f"creating project '{key}'", catch_http_errors=(HTTPStatus.BAD_REQUEST,))
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/utilities.py", line 518, in handle_error
    raise e
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/projects.py", line 214, in create
    endpoint.post(Project.API[c.CREATE], params={"project": key, "name": name})
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/platform.py", line 200, in post
    return self.__run_request(requests.post, api, params, **kwargs)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/platform.py", line 268, in __run_request
    util.handle_error(e, "")
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/utilities.py", line 518, in handle_error
    raise e
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/sonar/platform.py", line 250, in __run_request
    r = request(
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/requests/api.py", line 115, in post
    return request("post", url, data=data, json=json, **kwargs)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/requests/api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/Users/jakwak4/Library/Python/3.10/lib/python/site-packages/requests/adapters.py", line 713, in send
    raise ReadTimeout(e, request=request)
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='xxxxx-sonarqube-secondary.xxxxxxx.net', port=443): Read timed out. (read timeout=10)

Thanks

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

No branches or pull requests

2 participants