TrueNAS Runtime Configuration Errors with Webhook Integrations

Hello, first post here,

I created a GitLab instance on a local TrueNAS server, so I recognize that there is clearly some differences in deployment. Whenever I tested an integration it would error with “Something went wrong on our end”

Digging deeper in the logs I found the following error in integrations_json.log

{
    "severity": "ERROR",
    "time": "2023-05-12T17:17:14.976Z",
    "correlation_id": "01H08FEY9R8DFPXGCQHV0T0HHV",
    "integration_class": "Integrations::Discord",
    "integration_id": 16,
    "project_id": 10,
    "project_path": "scratch",
    "message": "uninitialized constant Net::HTTP::ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE\n\n      ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nDid you mean?  EnvironmentStatusSerializer",
    "exception.class": "NameError",
    "exception.message": "uninitialized constant Net::HTTP::ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE\n\n      ENVIRONMENT_VARIABLE_IS_MULTIUSER_SAFE\n      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\nDid you mean?  EnvironmentStatusSerializer",
    "exception.backtrace": [
        "config/initializers/net_http_patch.rb:30:in `environment_variable_is_multiuser_safe?'",
        "config/initializers/net_http_patch.rb:12:in `proxy_user'",
        "config/initializers/rest-client-hostname_override.rb:26:in `transmit'",
        "app/models/integrations/discord.rb:80:in `notify'",
        "app/models/integrations/base_chat_notification.rb:144:in `execute'",
        "app/workers/integrations/execute_worker.rb:21:in `perform'",
        "lib/gitlab/database/load_balancing/sidekiq_server_middleware.rb:26:in `call'",
        "lib/gitlab/sidekiq_middleware/duplicate_jobs/strategies/until_executing.rb:16:in `perform'",
        "lib/gitlab/sidekiq_middleware/duplicate_jobs/duplicate_job.rb:44:in `perform'",
        "lib/gitlab/sidekiq_middleware/duplicate_jobs/server.rb:8:in `call'",
        "lib/gitlab/sidekiq_middleware/worker_context.rb:9:in `wrap_in_optional_context'",
        "lib/gitlab/sidekiq_middleware/worker_context/server.rb:19:in `block in call'",
        "lib/gitlab/application_context.rb:115:in `block in use'",
        "lib/gitlab/application_context.rb:115:in `use'",
        "lib/gitlab/application_context.rb:55:in `with_context'",
        "lib/gitlab/sidekiq_middleware/worker_context/server.rb:17:in `call'",
        "lib/gitlab/sidekiq_status/server_middleware.rb:7:in `call'",
        "lib/gitlab/sidekiq_versioning/middleware.rb:9:in `call'",
        "lib/gitlab/sidekiq_middleware/query_analyzer.rb:7:in `block in call'",
        "lib/gitlab/database/query_analyzer.rb:37:in `within'",
        "lib/gitlab/sidekiq_middleware/query_analyzer.rb:7:in `call'",
        "lib/gitlab/sidekiq_middleware/admin_mode/server.rb:14:in `call'",
        "lib/gitlab/sidekiq_middleware/instrumentation_logger.rb:9:in `call'",
        "lib/gitlab/sidekiq_middleware/batch_loader.rb:7:in `call'",
        "lib/gitlab/sidekiq_middleware/extra_done_log_metadata.rb:7:in `call'",
        "lib/gitlab/sidekiq_middleware/request_store_middleware.rb:10:in `block in call'",
        "lib/gitlab/with_request_store.rb:17:in `enabling_request_store'",
        "lib/gitlab/with_request_store.rb:10:in `with_request_store'",
        "lib/gitlab/sidekiq_middleware/request_store_middleware.rb:9:in `call'",
        "lib/gitlab/sidekiq_middleware/server_metrics.rb:76:in `block in call'",
        "lib/gitlab/sidekiq_middleware/server_metrics.rb:103:in `block in instrument'",
        "lib/gitlab/metrics/background_transaction.rb:33:in `run'",
        "lib/gitlab/sidekiq_middleware/server_metrics.rb:103:in `instrument'",
        "lib/gitlab/sidekiq_middleware/server_metrics.rb:75:in `call'",
        "lib/gitlab/sidekiq_middleware/monitor.rb:10:in `block in call'",
        "lib/gitlab/sidekiq_daemon/monitor.rb:46:in `within_job'",
        "lib/gitlab/sidekiq_middleware/monitor.rb:9:in `call'",
        "lib/gitlab/sidekiq_middleware/size_limiter/server.rb:13:in `call'",
        "lib/gitlab/sidekiq_logging/structured_logger.rb:21:in `call'"
    ]
}

unfortunately this is a fun error for running gitlab in a BSD jail since I don’t know how to configure this environment variable in a Jail to persist through reboots, nor what this should be configured to.

Looking through the ruby code the function “environment_variable_is_multiuser_safe?” seems pretty simple. I patched the function to return true (I wouldn’t advise this as a solution, just testing) as seen in the attached image, and was able to see the integration trigger.

Not sure if this is a consistent problem for others in a similar environment, or if this is related to any open issues but I wanted to share that experience if it helps others get closer to an actual solution.