Repository: open-telemetry/opentelemetry-python-contrib

Issue:
ERROR: No matching distribution found for opentelemetry-instrumentation-aiohttp-server==0.42b0
Python Version - 3.8

**Steps to reproduce**
Using 'opentelemetry-bootstrap -a install' Command to Install the Dependencies for Auto Instrumentation.

**What is the expected behavior?**
package : opentelemetry-instrumentation-aiohttp-server==0.42b0 should be downloaded from pypi

**What is the actual behavior?**
ERROR: No matching distribution found for opentelemetry-instrumentation-aiohttp-server==0.42b0



Discussion:
There was an issue releasing the new version of `opentelemetry-instrumentation-aiohttp-server==0.42b0`, we are working on it to get it resolved.
This is also breaking for users (like me) that bring in all instrumentations transitively by depending on `opentelemetry-contrib-instrumentations`. For example, this is broken (poetry example):

```toml
opentelemetry-contrib-instrumentations = { version = "0.42b0" }
```

In poetry it fails with:

```
Because opentelemetry-contrib-instrumentations (0.42b0) depends on opentelemetry-instrumentation-aiohttp-server (0.42b0) which doesn't match any versions, opentelemetry-contrib-instrumentations is forbidden.
```
We are also affected by this. We've removed opentelemetry instrumention temporarily as a workaround, but this is not an option for everybody of course.
any updates on this issue?
Receiving the same behaviour with 3.10.3

```
$ opentelemetry-bootstrap -a install
ERROR: Could not find a version that satisfies the requirement opentelemetry-instrumentation-aiohttp-server==0.42b0 (from versions: none)
ERROR: No matching distribution found for opentelemetry-instrumentation-aiohttp-server==0.42b0
```
> There was an issue releasing the new version of `opentelemetry-instrumentation-aiohttp-server==0.42b0`, we are working on it to get it resolved.

Any ETA for this issue resolution.??
As we are forced to disable the instrumentation.
This issue posted last month and still not working. At least to have a workaround before new version release
> There was an issue releasing the new version of `opentelemetry-instrumentation-aiohttp-server==0.42b0`, we are working on it to get it resolved.

Hi Team,
Kindly help here with resolution. We need to disable instrumentation for all affected services.
We fixed it by using the previous version:

```
pip install opentelemetry-distro==0.41b0 opentelemetry-exporter-otlp==1.20.0
```

After this `opentelemetry-bootstrap --action install` works fine.
The above fix works- but would be great to have a complete fix and get back to reliable python install.
In 0.43b0 I'm seeing this same error but with the `opentelemetry-instrumentation-aws-lambda==0.43b0` package and possibly others.
Confirmed still broken in 0.43b0 for `opentelemetry-instrumentation-aiohttp-server`
We have this issue because we can't release this package anymore to PyPi, we have reported it [here](https://github.com/pypi/support/issues/3353) already.
I'm investigating a workaround for the time being, will report back here...

Resolving patch:
diff --git a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
--- a/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
+++ b/opentelemetry-instrumentation/src/opentelemetry/instrumentation/bootstrap_gen.py
@@ -24,10 +24,6 @@
         "library": "aiohttp ~= 3.0",
         "instrumentation": "opentelemetry-instrumentation-aiohttp-client==0.46b0.dev",
     },
-    {
-        "library": "aiohttp ~= 3.0",
-        "instrumentation": "opentelemetry-instrumentation-aiohttp-server==0.46b0.dev",
-    },
     {
         "library": "aiopg >= 0.13.0, < 2.0.0",
         "instrumentation": "opentelemetry-instrumentation-aiopg==0.46b0.dev",
@@ -191,7 +187,6 @@
     "opentelemetry-instrumentation-dbapi==0.46b0.dev",
     "opentelemetry-instrumentation-logging==0.46b0.dev",
     "opentelemetry-instrumentation-sqlite3==0.46b0.dev",
-    "opentelemetry-instrumentation-threading==0.46b0.dev",
     "opentelemetry-instrumentation-urllib==0.46b0.dev",
     "opentelemetry-instrumentation-wsgi==0.46b0.dev",
 ]
diff --git a/scripts/otel_packaging.py b/scripts/otel_packaging.py
--- a/scripts/otel_packaging.py
+++ b/scripts/otel_packaging.py
@@ -12,43 +12,55 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-import os
-import subprocess
-from subprocess import CalledProcessError
+from tomli import load
+from os import path, listdir
+from subprocess import check_output, CalledProcessError
+from requests import get
 
-import tomli
-
-scripts_path = os.path.dirname(os.path.abspath(__file__))
-root_path = os.path.dirname(scripts_path)
-instrumentations_path = os.path.join(root_path, "instrumentation")
+scripts_path = path.dirname(path.abspath(__file__))
+root_path = path.dirname(scripts_path)
+instrumentations_path = path.join(root_path, "instrumentation")
 
 
 def get_instrumentation_packages():
-    for pkg in sorted(os.listdir(instrumentations_path)):
-        pkg_path = os.path.join(instrumentations_path, pkg)
-        if not os.path.isdir(pkg_path):
+    for pkg in sorted(listdir(instrumentations_path)):
+        pkg_path = path.join(instrumentations_path, pkg)
+        if not path.isdir(pkg_path):
             continue
 
+        error = f"Could not get version for package {pkg}"
+
         try:
-            version = subprocess.check_output(
+            hatch_version = check_output(
                 "hatch version",
                 shell=True,
                 cwd=pkg_path,
-                universal_newlines=True,
+                universal_newlines=True
             )
+
         except CalledProcessError as exc:
             print(f"Could not get hatch version from path {pkg_path}")
             print(exc.output)
-            raise exc
 
-        pyproject_toml_path = os.path.join(pkg_path, "pyproject.toml")
+        try:
+            response = get(f"https://pypi.org/pypi/{pkg}/json", timeout=10)
+
+        except Exception:
+            print(error)
+            continue
+
+        if response.status_code != 200:
+            print(error)
+            continue
+
+        pyproject_toml_path = path.join(pkg_path, "pyproject.toml")
 
         with open(pyproject_toml_path, "rb") as file:
-            pyproject_toml = tomli.load(file)
+            pyproject_toml = load(file)
 
         instrumentation = {
             "name": pyproject_toml["project"]["name"],
-            "version": version.strip(),
+            "version": hatch_version.strip(),
             "instruments": pyproject_toml["project"]["optional-dependencies"][
                 "instruments"
             ],


Test patch: