fedora-infra / bodhi

Bodhi is a web-system that facilitates the process of publishing updates for a Fedora-based software distribution.
https://bodhi.fedoraproject.org
GNU General Public License v2.0
155 stars 196 forks source link

Missing __init__.py in compiled rpm bodhi module would cause bodhi module unable to be found error in the newest commited version #4453

Closed edwardlewis35 closed 2 years ago

edwardlewis35 commented 2 years ago

[Fri Apr 08 02:05:29.633915 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] mod_wsgi (pid=2608): Failed to exec Python script file '/usr/share/bodhi/bodhi.wsgi'. [Fri Apr 08 02:05:29.634029 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] mod_wsgi (pid=2608): Exception occurred processing WSGI script '/usr/share/bodhi/bodhi.wsgi'. [Fri Apr 08 02:05:29.638616 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] Traceback (most recent call last): [Fri Apr 08 02:05:29.638736 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pyramid/config/actions.py", line 308, in execute_actions [Fri Apr 08 02:05:29.638758 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] callable(*args, **kw) [Fri Apr 08 02:05:29.638780 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pyramid_mako/init.py", line 252, in register [Fri Apr 08 02:05:29.638809 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] opts = parse_options_from_settings( [Fri Apr 08 02:05:29.638832 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pyramid_mako/init.py", line 198, in parse_options_from_settings [Fri Apr 08 02:05:29.638848 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] directories = [abspath_from_asset_spec(d) for d in directories] [Fri Apr 08 02:05:29.638869 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pyramid_mako/init.py", line 198, in [Fri Apr 08 02:05:29.638884 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] directories = [abspath_from_asset_spec(d) for d in directories] [Fri Apr 08 02:05:29.638905 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pyramid/asset.py", line 46, in abspath_from_asset_spec [Fri Apr 08 02:05:29.638920 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] print(pkg_resources.resource_filename(pname, filename)) [Fri Apr 08 02:05:29.638940 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 1130, in resource_filename [Fri Apr 08 02:05:29.638955 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] return get_provider(package_or_requirement).get_resource_filename( [Fri Apr 08 02:05:29.639004 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 349, in get_provider [Fri Apr 08 02:05:29.639025 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] return _find_adapter(_provider_factories, loader)(module) [Fri Apr 08 02:05:29.639046 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib/python3.10/site-packages/pkg_resources/init.py", line 1379, in init [Fri Apr 08 02:05:29.639061 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] self.module_path = os.path.dirname(getattr(module, 'file', '')) [Fri Apr 08 02:05:29.639081 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] File "/usr/lib64/python3.10/posixpath.py", line 155, in dirname [Fri Apr 08 02:05:29.639095 2022] [wsgi:error] [pid 2608:tid 2709] [remote 172.17.127.159:43972] p = os.fspath(p)

TypeError: expected str, bytes or os.PathLike object, not NoneType

bodhi

edwardlewis35 commented 2 years ago

/usr/lib/python3.10/site-packages/bodhi

abompard commented 2 years ago

Thanks for the report! Could you paste your development.ini or production.ini file please, without the secrets (authtkt.secret, session.secret, oidc.fedora.client_secret and sqlalchemy.url) ? Are you running this in Vagrant or on a server/VM somewhere?

edwardlewis35 commented 2 years ago

Hello!!

production.ini

[app:main]
use = egg:bodhi-server
base_address = 
dogpile.cache.backend = dogpile.cache.dbm
dogpile.cache.expiration_time = 100
dogpile.cache.arguments.filename = /var/cache/bodhi/bodhi-dogpile-cache.dbm
warm_cache_on_start = True
buildsystem = koji
koji_web_url = 
koji_hub = 
fedora.mandatory_days_in_testing = 7
fedora_epel.mandatory_days_in_testing = 14

oidc.fedora.client_id = 
oidc.fedora.client_secret = 
oidc.fedora.server_metadata_url = 
oidc.fedora.authorize_url = 

cors_origins_ro = *
cors_origins_rw = https://bodhi.fedoraproject.org
cors_connect_src = https://*.fedoraproject.org/ wss://hub.fedoraproject.org:9939/
pyramid.reload_templates = true
pyramid.debug_authorization = true
pyramid.debug_notfound = true
pyramid.debug_routematch = true
pyramid.default_locale_name = en
debugtoolbar.hosts = 127.0.0.1 ::1
sqlalchemy.url = 
mako.directories = bodhi:server/templates
authtkt.secret = 
session.secret =
authtkt.secure = True
authtkt.timeout = 86400
session.type = file
session.data_dir = %(here)s/data/sessions/data
session.lock_dir = %(here)s/data/sessions/lock
session.key = mykey
session.cookie_on_exception = true
session.secure = true
session.timeout = 86400
cache.regions = default_term, second, short_term, long_term
cache.type = memory
cache.second.expire = 1
cache.short_term.expire = 60
cache.default_term.expire = 300
cache.long_term.expire = 3600
celery_config = /etc/bodhi/celeryconfig.py
docs_path = /usr/share/doc/bodhi-docs/html/
[server:main]
use = egg:waitress#main
host = 0.0.0.0
port = 6543
[pshell]
m = bodhi.server.models
t = transaction
[loggers]
keys = root, bodhi, sqlalchemy, celery, celery_worker_job
[handlers]
keys = console
[formatters]
keys = generic
[logger_root]
level = INFO
handlers = console
[logger_bodhi]
level = DEBUG
handlers =
qualname = bodhi
[logger_sqlalchemy]
level = INFO
handlers =
qualname = sqlalchemy.engine
[logger_celery]
level = INFO
handlers =
qualname = celery
[logger_celery_worker_job]
level = ERROR
handlers =
qualname = celery.worker.job
propagate = 1
[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
[formatter_generic]
format = %(asctime)s %(levelname)-5.5s [%(name)s][%(threadName)s] %(message)s

environment

NAME="Fedora Linux"
VERSION="35 (Container Image)"
ID=fedora
VERSION_ID=35
VERSION_CODENAME=""
PLATFORM_ID="platform:f35"
PRETTY_NAME="Fedora Linux 35 (Container Image)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:35"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f35/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=35
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=35
PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy"
VARIANT="Container Image"
VARIANT_ID=container

with .SPEC files provided in bodhi-client, bodhi-message and bodhi-server, I built them into rpms and install them on my local podman machine, when i run the command 'systemctl start httpd', I encountered a Internal server error which logged messages as I pasted before! touch /usr/lib/python3.10/site-packages/bodhi/__init__.py would fix this error