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 · 0 comments
Open

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

Jay-jakwak4 opened this issue Nov 18, 2024 · 0 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

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

1 participant