Issue 1:
Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussions forum first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Related Issues

None

Environment & Settings

Celery version: 5.2.7 (dawn-chorus)

celery -A proj report Output:

DEBUG 2022-11-14 17:24:37,373 datadog.util conditional_lru_cache 130 : Enabling LRU cache for function _normalize_tags_with_cache
INFO 2022-11-14 17:24:37,381 datadog.dogstatsd __init__ 317 : Statsd buffering is disabled
INFO 2022-11-14 17:24:37,381 datadog.dogstatsd _start_flush_thread 335 : Statsd periodic buffer flush is disabled
DEBUG 2022-11-14 17:24:37,408 ddtrace.internal.module install 482 : <class 'ddtrace.internal.module.ModuleWatchdog'> installed
DEBUG 2022-11-14 17:24:37,507 ddtrace.sampler __init__ 99 : initialized RateSampler, sample 100.0% of traces
DEBUG 2022-11-14 17:24:37,507 ddtrace.sampler __init__ 274 : initialized DatadogSampler(agent_rates={}, limiter=RateLimiter(rate_limit=100, tokens=100, last_update_ns=1719313673348, effective_rate=1.0), rules=[])
DEBUG 2022-11-14 17:24:37,507 ddtrace.sampler __init__ 99 : initialized RateSampler, sample 100.0% of traces
DEBUG 2022-11-14 17:24:37,516 ddtrace.internal.processor.trace __attrs_post_init__ 43 : initialized trace processor TraceTagsProcessor()
DEBUG 2022-11-14 17:24:37,516 ddtrace.internal.processor.trace __attrs_post_init__ 43 : initialized trace processor TraceSamplingProcessor(_compute_stats_enabled=False)
DEBUG 2022-11-14 17:24:37,516 ddtrace.internal.processor __attrs_post_init__ 31 : initialized processor TopLevelSpanProcessor()
DEBUG 2022-11-14 17:24:37,516 ddtrace.internal.processor __attrs_post_init__ 31 : initialized processor SpanAggregator(_partial_flush_enabled=True, _partial_flush_min_spans=500, _trace_processors=[TraceTagsProcessor(), TraceSamplingProcessor(_compute_stats_enabled=False)], _writer=AgentWriter(status=<ServiceStatus.STOPPED: 'stopped'>, _interval=1.0))
DEBUG 2022-11-14 17:24:37,517 ddtrace.internal.processor.trace __attrs_post_init__ 43 : initialized trace processor EndpointsTraceFilter()
DEBUG 2022-11-14 17:24:37,517 ddtrace.internal.processor.trace __attrs_post_init__ 43 : initialized trace processor TraceTagsProcessor()
DEBUG 2022-11-14 17:24:37,517 ddtrace.internal.processor.trace __attrs_post_init__ 43 : initialized trace processor TraceSamplingProcessor(_compute_stats_enabled=False)
DEBUG 2022-11-14 17:24:37,517 ddtrace.internal.processor __attrs_post_init__ 31 : initialized processor TopLevelSpanProcessor()
DEBUG 2022-11-14 17:24:37,517 ddtrace.internal.processor __attrs_post_init__ 31 : initialized processor SpanAggregator(_partial_flush_enabled=True, _partial_flush_min_spans=500, _trace_processors=[TraceTagsProcessor(), TraceSamplingProcessor(_compute_stats_enabled=False), EndpointsTraceFilter()], _writer=AgentWriter(status=<ServiceStatus.STOPPED: 'stopped'>, _interval=1.0))
DEBUG 2022-11-14 17:24:37,519 ddtrace._monkey _patch_module 257 : integration aioredis not enabled (missing required module: aioredis)
DEBUG 2022-11-14 17:24:37,520 ddtrace._monkey _patch_module 257 : integration aiomysql not enabled (missing required module: aiomysql)
DEBUG 2022-11-14 17:24:37,521 ddtrace._monkey _patch_module 257 : integration aredis not enabled (missing required modules: aredis,aredis.client)
DEBUG 2022-11-14 17:24:37,529 ddtrace._monkey _patch_module 257 : integration boto not enabled (missing required module: boto.connection)
DEBUG 2022-11-14 17:24:37,530 ddtrace._monkey _patch_module 257 : integration cassandra not enabled (missing required module: cassandra.cluster)
DEBUG 2022-11-14 17:24:37,534 ddtrace._monkey _patch_module 257 : integration consul not enabled (missing required module: consul)
DEBUG 2022-11-14 17:24:37,535 ddtrace._monkey _patch_module 257 : integration django not enabled (missing required module: django)
DEBUG 2022-11-14 17:24:37,537 ddtrace._monkey _patch_module 257 : integration algoliasearch not enabled (missing required modules: algoliasearch,algoliasearch.version)
DEBUG 2022-11-14 17:24:37,539 ddtrace._monkey _patch_module 257 : integration graphql not enabled (missing required module: graphql)
DEBUG 2022-11-14 17:24:37,540 ddtrace._monkey _patch_module 257 : integration grpc not enabled (missing required module: grpc)
DEBUG 2022-11-14 17:24:37,541 ddtrace._monkey _patch_module 257 : integration httpx not enabled (missing required module: httpx)
DEBUG 2022-11-14 17:24:37,542 ddtrace._monkey _patch_module 257 : integration mongoengine not enabled (missing required module: mongoengine)
DEBUG 2022-11-14 17:24:37,543 ddtrace._monkey _patch_module 257 : integration mysql not enabled (missing required module: mysql.connector)
DEBUG 2022-11-14 17:24:37,544 ddtrace._monkey _patch_module 257 : integration mysqldb not enabled (missing required module: MySQLdb)
DEBUG 2022-11-14 17:24:37,545 ddtrace._monkey _patch_module 257 : integration pymysql not enabled (missing required module: pymysql)
DEBUG 2022-11-14 17:24:37,546 ddtrace._monkey _patch_module 257 : integration mariadb not enabled (missing required module: mariadb)
DEBUG 2022-11-14 17:24:37,547 ddtrace._monkey _patch_module 257 : integration psycopg not enabled (missing required module: psycopg2)
DEBUG 2022-11-14 17:24:37,548 ddtrace._monkey _patch_module 257 : integration pylibmc not enabled (missing required module: pylibmc)
DEBUG 2022-11-14 17:24:37,549 ddtrace._monkey _patch_module 257 : integration pymemcache not enabled (missing required module: pymemcache)
DEBUG 2022-11-14 17:24:37,550 ddtrace._monkey _patch_module 257 : integration pymongo not enabled (missing required module: pymongo)
DEBUG 2022-11-14 17:24:37,565 ddtrace._monkey _patch_module 257 : integration rediscluster not enabled (missing required modules: rediscluster,rediscluster.client)
DEBUG 2022-11-14 17:24:37,579 ddtrace._monkey _patch_module 257 : integration sanic not enabled (missing required module: sanic)
DEBUG 2022-11-14 17:24:37,585 ddtrace._monkey _patch_module 257 : integration aiohttp_jinja2 not enabled (missing required module: aiohttp_jinja2)
DEBUG 2022-11-14 17:24:37,586 ddtrace._monkey _patch_module 257 : integration aiopg not enabled (missing required module: aiopg)
DEBUG 2022-11-14 17:24:37,587 ddtrace._monkey _patch_module 257 : integration vertica not enabled (missing required module: vertica_python)
DEBUG 2022-11-14 17:24:37,588 ddtrace._monkey _patch_module 257 : integration molten not enabled (missing required module: molten)
DEBUG 2022-11-14 17:24:37,591 ddtrace._monkey _patch_module 257 : integration mako not enabled (missing required module: mako)
DEBUG 2022-11-14 17:24:37,598 ddtrace._monkey _patch_module 257 : integration starlette not enabled (missing required module: starlette)
DEBUG 2022-11-14 17:24:37,600 ddtrace._monkey _patch_module 257 : integration pyodbc not enabled (missing required module: pyodbc)
DEBUG 2022-11-14 17:24:37,601 ddtrace._monkey _patch_module 257 : integration fastapi not enabled (missing required module: fastapi)
DEBUG 2022-11-14 17:24:37,602 ddtrace._monkey _patch_module 257 : integration dogpile_cache not enabled (missing required module: dogpile.cache)
DEBUG 2022-11-14 17:24:37,603 ddtrace._monkey _patch_module 257 : integration yaaredis not enabled (missing required modules: yaaredis,yaaredis.client)
DEBUG 2022-11-14 17:24:37,604 ddtrace._monkey _patch_module 257 : integration asyncpg not enabled (missing required module: asyncpg)
INFO 2022-11-14 17:24:37,604 ddtrace._monkey patch 234 : patched 14/47 modules (aiohttp,asyncio,botocore,celery,elasticsearch,flask,futures,gevent,jinja2,pynamodb,redis,requests,rq,sqlite3)
DEBUG 2022-11-14 17:24:37,622 ddtrace.span set_tag 295 : ignoring not number metric _dd1.sr.eausr:None
DEBUG 2022-11-14 17:24:37,687 ddtrace.tracer _on_span_finish 751 : finishing span name='redis.command' id=12705636483851023144 trace_id=197718079717498873 parent_id=None service='redis' resource='GET ' type='redis' start=1668446677.6225154 end=1668446677.6333628 duration=0.010847229 error=0 tags={'_dd.p.dm': '-0', 'env': 'stg', 'out.host': 'redis.2063-vault-stg.aws.ldg-stg.net', 'redis.raw_command': 'GET ', 'runtime-id': '5f3021787caa443c9148b29657f3d8e9'} metrics={'_dd.agent_psr': 1.0, '_dd.measured': 1, '_dd.top_level': 1, '_dd.tracer_kr': 1.0, '_sampling_priority_v1': 1, 'out.port': 6379, 'out.redis_db': 3, 'redis.args_length': 2, 'system.pid': 36} (enabled:True)
{"mode": "PROD", "event": "Configure structlog", "logger": "logging", "level": "info", "timestamp": "2022-11-14T17:24:37.691199Z", "dd.trace_id": "0", "dd.span_id": "0"}
{"message": "TypeError(\"'method' object is not iterable\")", "traceback": "b'Traceback (most recent call last):\\\\n File \"/app/.venv/bin/celery\", line 8, in <module>\\\\n sys.exit(main())\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/__main__.py\", line 15, in main\\\\n sys.exit(_main())\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/bin/celery.py\", line 217, in main\\\\n return celery(auto_envvar_prefix=\"CELERY\")\\\\n File \"/app/.venv/lib/python3.9/site-packages/click/core.py\", line 1130, in __call__\\\\n return self.main(*args, **kwargs)\\\\n File \"/app/.venv/lib/python3.9/site-packages/click/core.py\", line 1055, in main\\\\n rv = self.invoke(ctx)\\\\n File \"/app/.venv/lib/python3.9/site-packages/click/core.py\", line 1657, in invoke\\\\n return _process_result(sub_ctx.command.invoke(sub_ctx))\\\\n File \"/app/.venv/lib/python3.9/site-packages/click/core.py\", line 1404, in invoke\\\\n return ctx.invoke(self.callback, **ctx.params)\\\\n File \"/app/.venv/lib/python3.9/site-packages/click/core.py\", line 760, in invoke\\\\n return __callback(*args, **kwargs)\\\\n File \"/app/.venv/lib/python3.9/site-packages/click/decorators.py\", line 26, in new_func\\\\n return f(get_current_context(), *args, **kwargs)\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/bin/celery.py\", line 162, in report\\\\n ctx.obj.echo(app.bugreport())\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/base.py\", line 952, in bugreport\\\\n return bugreport(self)\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/utils.py\", line 374, in bugreport\\\\n human_settings=app.conf.humanize(),\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/utils.py\", line 196, in humanize\\\\n for key, value in self.table(with_defaults, censored).items())\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/utils.py\", line 187, in table\\\\n return filt({\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/utils.py\", line 344, in filter_hidden_settings\\\\n return {k: maybe_censor(k, v) for k, v in conf.items()}\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/utils.py\", line 344, in <dictcomp>\\\\n return {k: maybe_censor(k, v) for k, v in conf.items()}\\\\n File \"/app/.venv/lib/python3.9/site-packages/celery/app/utils.py\", line 338, in maybe_censor\\\\n return Connection(value).as_uri(mask=mask)\\\\n File \"/app/.venv/lib/python3.9/site-packages/kombu/connection.py\", line 166, in __init__\\\\n alt.extend(hostname)\\\\nTypeError: \\'method\\' object is not iterable\\\\n'", "event": "TypeError(\"'method' object is not iterable\")", "logger": "logging", "level": "error", "timestamp": "2022-11-14T17:24:37.750520Z", "dd.trace_id": "0", "dd.span_id": "0"}

Steps to Reproduce

Required Dependencies

Minimal Python Version: N/A or Unknown

Minimal Celery Version: I tested against 4.4.7 it's working. but I didn't test against higher versions other than 5.2.7.

Minimal Kombu Version: N/A or Unknown

Minimal Broker Version: N/A or Unknown

Minimal Result Backend Version: N/A or Unknown

Minimal OS and/or Kernel Version: N/A or Unknown

Minimal Broker Client Version: N/A or Unknown

Minimal Result Backend Client Version: N/A or Unknown

Python Packages

pip freeze Output:

amqp==5.1.1
asgiref==3.5.2
async-timeout==4.0.2
attrs==22.1.0
billiard==3.6.4.0
bytecode==0.13.0
cattrs==22.2.0
celery==5.2.7
certifi==2022.9.24
charset-normalizer==2.1.1
click==8.1.3
click-didyoumean==0.3.0
click-plugins==1.1.1
click-repl==0.2.0
colorama==0.4.6
commonmark==0.9.1
datadog==0.44.0
ddsketch==2.0.4
ddtrace==1.6.0
decorator==5.1.1
Deprecated==1.2.13
envier==0.4.0
exceptiongroup==1.0.2
Flask==2.2.2
Flask-Cors==3.0.10
Flask-Limiter==2.8.0
flower==1.2.0
forbiddenfruit==0.1.4
humanize==4.4.0
idna==3.4
importlib-metadata==5.0.0
itsdangerous==2.1.2
Jinja2==3.1.2
jsonschema==4.17.0
kombu==5.2.4
limits==2.7.1
MarkupSafe==2.1.1
marshmallow==3.19.0
marshmallow-dataclass==8.5.10
marshmallow-enum==1.5.1
mypy-extensions==0.4.3
packaging==21.3
pika==1.3.1
prometheus-client==0.15.0
prompt-toolkit==3.0.32
protobuf==4.21.9
py==1.11.0
Pygments==2.13.0
pyparsing==3.0.9
pyrsistent==0.19.2
python-dateutil==2.8.2
python-ledgercommon==1.52.7
python-redis-lock==4.0.0
pytz==2022.6
PyYAML==6.0
redis==4.3.4
requests==2.28.1
retry==0.9.2
retrying==1.3.3
rich==12.6.0
rq==1.11.1
six==1.16.0
structlog==22.1.0
structlog-pretty==0.3.0
tenacity==8.1.0
tornado==6.2
typeguard==2.13.3
typing-inspect==0.8.0
typing_extensions==4.4.0
urllib3==1.26.12
uWSGI==2.0.21
vault-common==1.0.2
vine==5.0.0
wcwidth==0.2.5
Werkzeug==2.2.2
wrapt==1.14.1
xmltodict==0.13.0
zipp==3.10.0

Other Dependencies

N/A

Minimally Reproducible Test Case

Expected Behavior

no error is shown when starting celery worker

Actual Behavior

the aforementioned error is shown, detailed below in the stacktrace

Traceback (most recent call last):
File "/app/.venv/lib/python3.9/site-packages/kombu/pidbox.py", line 100, in dispatch
reply = handle(method, arguments)
File "/app/.venv/lib/python3.9/site-packages/kombu/pidbox.py", line 119, in handle_call
return self.handle(method, arguments)
File "/app/.venv/lib/python3.9/site-packages/kombu/pidbox.py", line 116, in handle
return self.handlers[method](self.state, **arguments)
File "/app/.venv/lib/python3.9/site-packages/celery/worker/control.py", line 91, in conf
return jsonify(state.app.conf.table(with_defaults=with_defaults),
File "/app/.venv/lib/python3.9/site-packages/celery/app/utils.py", line 187, in table
return filt({
File "/app/.venv/lib/python3.9/site-packages/celery/app/utils.py", line 344, in filter_hidden_settings
return {k: maybe_censor(k, v) for k, v in conf.items()}
File "/app/.venv/lib/python3.9/site-packages/celery/app/utils.py", line 344, in <dictcomp>
return {k: maybe_censor(k, v) for k, v in conf.items()}
File "/app/.venv/lib/python3.9/site-packages/celery/app/utils.py", line 338, in maybe_censor
return Connection(value).as_uri(mask=mask)
File "/app/.venv/lib/python3.9/site-packages/kombu/connection.py", line 166, in __init__
alt.extend(hostname)
TypeError: 'method' object is not iterable

Issue 2:
In #6558 the lack of celery.task was closed as "not a bug", but because task is still in the __all__ for the celery module package (in celery/__init__.py), among other things the missing module breaks pydoc:

$ python3 -m venv .
$ . ./bin/activate
$ python3 -m pip install celery
[...]
$ python3 -m pydoc celery
No module named 'celery.task'

$

Other introspection tools, not to mention freezing/packaging tools, will likely also be affected.

Checklist

I have verified that the issue exists against the master branch of Celery.

This has already been asked to the discussion group first.

I have read the relevant section in the

contribution guide

on reporting bugs.

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues

in this issue (If there are none, check this box anyway).

Mandatory Debugging Information

I have included the output of celery -A proj report in the issue.

(if you are not able to do this, then at least specify the Celery

version affected).

I have verified that the issue exists against the master branch of Celery.

I have included the contents of pip freeze in the issue.

I have included all the versions of all the external dependencies required

to reproduce this bug.

Optional Debugging Information

I have tried reproducing the issue on more than one Python version

and/or implementation.

I have tried reproducing the issue on more than one message broker and/or

result backend.

I have tried reproducing the issue on more than one version of the message

broker and/or result backend.

I have tried reproducing the issue on more than one operating system.

I have tried reproducing the issue on more than one workers pool.

I have tried reproducing the issue with autoscaling, retries,

ETA/Countdown & rate limits disabled.

I have tried reproducing the issue after downgrading

and/or upgrading Celery and its dependencies.

Related Issues and Possible Duplicates

Related Issues

#6558

Possible Duplicates

None

Environment & Settings

Celery version: 5.1.2 (sun-harmonics)

celery report Output:

```sh
$ celery report
software -> celery:5.1.2 (sun-harmonics) kombu:5.0.2 py:3.9.6
billiard:3.6.4.0 py-amqp:5.0.6
platform -> system:Linux arch:64bit, ELF
kernel version:5.12.15-200.fc33.x86_64 imp:CPython
loader -> celery.loaders.default.Loader
settings -> transport:amqp results:disabled

deprecated_settings: None

</p>
</details>

# Steps to Reproduce

## Required Dependencies
<!-- Please fill the required dependencies to reproduce this issue -->
* **Minimal Python Version**: N/A or Unknown
* **Minimal Celery Version**: N/A or Unknown
* **Minimal Kombu Version**: N/A or Unknown
* **Minimal Broker Version**: N/A or Unknown
* **Minimal Result Backend Version**: N/A or Unknown
* **Minimal OS and/or Kernel Version**: N/A or Unknown
* **Minimal Broker Client Version**: N/A or Unknown
* **Minimal Result Backend Client Version**: N/A or Unknown

### Python Packages
<!-- Please fill the contents of pip freeze below -->
<details>
<summary><b><code>pip freeze</code> Output:</b></summary>
<p>

amqp==5.0.6

billiard==3.6.4.0

celery==5.1.2

click==7.1.2

click-didyoumean==0.0.3

click-plugins==1.1.1

click-repl==0.2.0

kombu==5.1.0

prompt-toolkit==3.0.19

pytz==2021.1

six==1.16.0

vine==5.0.0

wcwidth==0.2.5

</p>
</details>

### Other Dependencies
<!--
Please provide system dependencies, configuration files
and other dependency information if applicable
-->
<details>
<p>
N/A
</p>
</details>

## Minimally Reproducible Test Case
<!--
Please provide a reproducible test case.
Refer to the Reporting Bugs section in our contribution guide.

We prefer submitting test cases in the form of a PR to our integration test suite.
If you can provide one, please mention the PR number below.
If not, please attach the most minimal code example required to reproduce the issue below.
If the test case is too large, please include a link to a gist or a repository below.
-->

```bash
$ python3 -m venv .
$ . ./bin/activate
$ python3 -m pip install celery
[...]
$ python3 -m pydoc celery
No module named 'celery.task'

$

Expected Behavior

Module documentation is displayed

Actual Behavior