text:
Relax prometheus_client version (#3161)

Description
Relax prometheus_client contraints.
Motivation and Context
Currently, prometheus_client is pinned at 0.5.0 which dates from 2018. Having strong contraints on old packages prevents the installation of luigi with other more up to date packages in environments.
Have you tested this? If so, how?
Ran the py39-contrib test suite:
$ python -m tox -e py39-contrib
py39-contrib create: /n/nvme1/nstinus/src/luigi/.tox/py39-contrib
py39-contrib installdeps: pytest<7.0, pytest-cov>=2.0,<3.0, mock<2.0, moto>=1.3.10, HTTPretty==0.8.10, docker>=2.1.0, boto>=2.42,<3.0, boto3>=1.11.0, pyhive[presto]==0.6.1, s3transfer>=0.3,<4.0, sqlalchemy<1.4, elasticsearch>=1.0.0,<2.0.0, psutil<4.0, mysql-connector-python>=8.0.12, avro-python3, google-compute-engine, coverage>=5.0,<6, codecov>=1.4.0, requests>=2.20.0,<3.0, pygments, hypothesis>=6.7.0,<7.0.0, selenium==3.0.2, pymongo==3.4.0, toml<2.0.0, responses<1.0.0, azure-storage<=0.36, datadog==0.22.0, prometheus-client>=0.5.0<0.15
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
py39-contrib develop-inst: /n/nvme1/nstinus/src/luigi
WARNING: Discarding $PYTHONPATH from environment, to override specify PYTHONPATH in 'passenv' in your configuration.
py39-contrib installed: attrs==21.4.0,avro-python3==1.10.2,azure-common==1.1.28,azure-nspkg==3.0.2,azure-storage==0.36.0,boto==2.49.0,boto3==1.22.10,botocore==1.25.10,certifi==2021.10.8,cffi==1.15.0,charset-normalizer==2.0.12,codecov==2.1.12,coverage==5.5,cryptography==37.0.2,datadog==0.22.0,decorator==5.1.1,distro==1.7.0,docker==5.0.3,docutils==0.18.1,elasticsearch==1.9.0,future==0.18.2,google-compute-engine==2.8.13,httpretty==0.8.10,hypothesis==6.46.2,idna==3.3,iniconfig==1.1.1,Jinja2==3.1.2,jmespath==1.0.0,lockfile==0.12.2,-e git+https://github.com/nstinus/luigi.git@e57372720f3bbdb09f4718e8a2ab78fff7f54443#egg=luigi,MarkupSafe==2.1.1,mock==1.3.0,moto==3.1.8,mysql-connector-python==8.0.29,packaging==21.3,pbr==5.9.0,pluggy==1.0.0,prometheus-client==0.14.1,protobuf==3.20.1,psutil==3.4.2,py==1.11.0,pycparser==2.21,Pygments==2.12.0,PyHive==0.6.1,pymongo==3.4.0,pyparsing==3.0.8,pytest==6.2.5,pytest-cov==2.12.1,python-daemon==2.3.0,python-dateutil==2.8.2,pytz==2022.1,requests==2.27.1,responses==0.20.0,s3transfer==0.5.2,selenium==3.0.2,simplejson==3.17.6,six==1.16.0,sortedcontainers==2.4.0,SQLAlchemy==1.3.24,tenacity==8.0.1,toml==0.10.2,tornado==6.1,urllib3==1.26.9,websocket-client==1.3.2,Werkzeug==2.1.2,xmltodict==0.13.0
py39-contrib run-test-pre: PYTHONHASHSEED='1142964723'
py39-contrib run-test: commands[0] | python --version
Python 3.8.10
py39-contrib run-test: commands[1] | python test/runtests.py -m contrib
=========================================================================================================== test session starts ============================================================================================================
platform linux -- Python 3.8.10, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/bin/python
cachedir: .tox/py39-contrib/.pytest_cache
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/n/nvme1/nstinus/src/luigi/.hypothesis/examples')
rootdir: /n/nvme1/nstinus/src/luigi, configfile: tox.ini, testpaths: test
plugins: cov-2.12.1, hypothesis-6.46.2
collected 1826 items / 1693 deselected / 11 skipped / 122 selected

test/contrib/cascading_test.py::CascadingClientTest::test_FileAlreadyExists_propagation PASSED                                                                                [  0%]
test/contrib/cascading_test.py::CascadingClientTest::test_failings PASSED                                                                                [  1%]
test/contrib/cascading_test.py::CascadingClientTest::test_fallbacking PASSED                                                                                [  2%]
test/contrib/cascading_test.py::CascadingClientTest::test_method_names_kwarg PASSED                                                                                [  3%]
test/contrib/cascading_test.py::CascadingClientTest::test_successes PASSED                                                                                [  3%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_always_log_stderr_on_failure PASSED                                                                                [  4%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_app_interruption PASSED                                                                                [  5%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_capture_output_set_to_false_writes_output_to_stdout PASSED                                                                                [  6%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_dont_log_stderr_on_success_if_disabled PASSED                                                                                [  6%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_handle_failed_job PASSED                                                                                [  7%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_log_stderr_on_success_by_default PASSED                                                                                [  8%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_no_url_searching_is_performed_if_pattern_is_not_set PASSED                                                                                [  9%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_non_mocked_task_run PASSED                                                                                [  9%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_program_args_must_be_implemented PASSED                                                                                [ 10%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_run PASSED                                                                                [ 11%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_tracking_url_context_works_correctly_when_logs_output_pattern_to_url_is_not_default PASSED                                                                      [ 12%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_tracking_url_context_works_without_capture_output PASSED                                                                                [ 12%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_tracking_url_pattern_works_with_capture_output_disabled PASSED                                                                                [ 13%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_tracking_url_pattern_works_with_capture_output_enabled PASSED                                                                                [ 14%]
test/contrib/external_program_test.py::ExternalProgramTaskTest::test_tracking_url_pattern_works_with_stderr PASSED                                                                                [ 15%]
test/contrib/external_program_test.py::ExternalPythonProgramTaskTest::test_original_environment_is_kept_intact PASSED                                                                                [ 15%]
test/contrib/external_program_test.py::ExternalPythonProgramTaskTest::test_pythonpath_is_prepended_if_not_empty PASSED                                                                                [ 16%]
test/contrib/external_program_test.py::ExternalPythonProgramTaskTest::test_pythonpath_is_set_if_empty PASSED                                                                                [ 17%]
test/contrib/external_program_test.py::ExternalPythonProgramTaskTest::test_venv_is_set_and_prepended_to_path PASSED                                                                                [ 18%]
test/contrib/lsf_test.py::TestSGEJob::test_run_job PASSED                                                                                [ 18%]
test/contrib/lsf_test.py::TestSGEJob::test_run_job_with_dump PASSED                                                                                [ 19%]
test/contrib/opener_test.py::TestOpenerTarget::test_binary_support PASSED                                                                                [ 20%]
test/contrib/opener_test.py::TestOpenerTarget::test_default_target PASSED                                                                                [ 21%]
test/contrib/opener_test.py::TestOpenerTarget::test_invalid_target PASSED                                                                                [ 21%]
test/contrib/opener_test.py::TestOpenerTarget::test_local_target PASSED                                                                                [ 22%]
test/contrib/opener_test.py::TestOpenerTarget::test_local_tmp_target PASSED                                                                                [ 23%]
test/contrib/opener_test.py::TestOpenerTarget::test_mock_target PASSED                                                                                [ 24%]
test/contrib/opener_test.py::TestOpenerTarget::test_mock_target_root PASSED                                                                                [ 24%]
test/contrib/opener_test.py::TestOpenerTarget::test_s3_parse PASSED                                                                                [ 25%]
test/contrib/opener_test.py::TestOpenerTarget::test_s3_parse_param PASSED                                                                                [ 26%]
test/contrib/prometheus_metric_test.py::PrometheusMetricTest::test_configure_http_handler PASSED                                                                                [ 27%]
test/contrib/prometheus_metric_test.py::PrometheusMetricTest::test_handle_task_disabled PASSED                                                                                [ 27%]
test/contrib/prometheus_metric_test.py::PrometheusMetricTest::test_handle_task_done PASSED                                                                                [ 28%]
test/contrib/prometheus_metric_test.py::PrometheusMetricTest::test_handle_task_failed PASSED                                                                                [ 29%]
test/contrib/prometheus_metric_test.py::PrometheusMetricTest::test_handle_task_started PASSED                                                                                [ 30%]
test/contrib/salesforce_test.py::TestSalesforceAPI::test_deprecated_results_warning PASSED                                                                                [ 30%]
test/contrib/salesforce_test.py::TestSalesforceAPI::test_result_ids PASSED                                                                                [ 31%]
test/contrib/salesforce_test.py::TestSalesforceQuery::test_multi_csv_download PASSED                                                                                [ 32%]
test/contrib/scalding_test.py::ScaldingTest::test_scalding PASSED                                                                                [ 33%]
test/contrib/sge_test.py::TestSGEWrappers::test_track_job PASSED                                                                                [ 33%]
test/contrib/sge_test.py::TestSGEJob::test_run_job PASSED                                                                                [ 34%]
test/contrib/sge_test.py::TestSGEJob::test_run_job_with_dump PASSED                                                                                [ 35%]
test/contrib/sqla_test.py::TestSQLA::test_column_row_separator PASSED                                                                                [ 36%]
test/contrib/sqla_test.py::TestSQLA::test_create_marker_table PASSED                                                                                [ 36%]
test/contrib/sqla_test.py::TestSQLA::test_create_table PASSED                                                                                [ 37%]
test/contrib/sqla_test.py::TestSQLA::test_create_table_raises_no_columns PASSED                                                                                [ 38%]
test/contrib/sqla_test.py::TestSQLA::test_multiple_engines PASSED                                                                                [ 39%]
test/contrib/sqla_test.py::TestSQLA::test_multiple_tasks PASSED                                                                                [ 39%]
test/contrib/sqla_test.py::TestSQLA::test_reflect PASSED                                                                                [ 40%]
test/contrib/sqla_test.py::TestSQLA::test_row_overload PASSED                                                                                [ 41%]
test/contrib/sqla_test.py::TestSQLA::test_rows PASSED                                                                                [ 42%]
test/contrib/sqla_test.py::TestSQLA::test_run PASSED                                                                                [ 42%]
test/contrib/sqla_test.py::TestSQLA::test_run_with_chunk_size PASSED                                                                                [ 43%]
test/contrib/sqla_test.py::TestSQLA::test_touch PASSED                                                                                [ 44%]
test/contrib/sqla_test.py::TestSQLA::test_update_rows_test PASSED                                                                                [ 45%]
test/contrib/sqla_test.py::TestSQLA2::test_column_row_separator PASSED                                                                                [ 45%]
test/contrib/sqla_test.py::TestSQLA2::test_create_marker_table PASSED                                                                                [ 46%]
test/contrib/sqla_test.py::TestSQLA2::test_create_table PASSED                                                                                [ 47%]
test/contrib/sqla_test.py::TestSQLA2::test_create_table_raises_no_columns PASSED                                                                                [ 48%]
test/contrib/sqla_test.py::TestSQLA2::test_multiple_engines PASSED                                                                                [ 48%]
test/contrib/sqla_test.py::TestSQLA2::test_multiple_tasks PASSED                                                                                [ 49%]
test/contrib/sqla_test.py::TestSQLA2::test_reflect PASSED                                                                                [ 50%]
test/contrib/sqla_test.py::TestSQLA2::test_row_overload PASSED                                                                                [ 51%]
test/contrib/sqla_test.py::TestSQLA2::test_rows PASSED                                                                                [ 51%]
test/contrib/sqla_test.py::TestSQLA2::test_run PASSED                                                                                [ 52%]
test/contrib/sqla_test.py::TestSQLA2::test_run_with_chunk_size PASSED                                                                                [ 53%]
test/contrib/sqla_test.py::TestSQLA2::test_touch PASSED                                                                                [ 54%]
test/contrib/sqla_test.py::TestSQLA2::test_update_rows_test PASSED                                                                                [ 54%]
test/contrib/test_ssh.py::TestRemoteContext::test_check_output PASSED                                                                                [ 55%]
test/contrib/test_ssh.py::TestRemoteContext::test_tunnel PASSED                                                                                [ 56%]
test/contrib/test_ssh.py::TestRemoteTarget::test_context_manager PASSED                                                                                [ 57%]
test/contrib/test_ssh.py::TestRemoteTarget::test_exists PASSED                                                                                [ 57%]
test/contrib/test_ssh.py::TestRemoteTarget::test_open PASSED                                                                                [ 58%]
test/contrib/test_ssh.py::TestRemoteTarget::test_remove PASSED                                                                                [ 59%]
test/contrib/test_ssh.py::TestRemoteFilesystem::test_list PASSED                                                                                [ 60%]
test/contrib/test_ssh.py::TestRemoteFilesystem::test_mkdir PASSED                                                                                [ 60%]
test/contrib/test_ssh.py::TestGetAttrRecursion::test_recursion_on_delete PASSED                                                                                [ 61%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_atomicity <- test/target_test.py PASSED                                                                                [ 62%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_binary_write <- test/target_test.py PASSED                                                                                [ 63%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_del <- test/target_test.py PASSED                                                                                [ 63%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_del_with_Text <- test/target_test.py PASSED                                                                                [ 64%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_format_injection <- test/target_test.py PASSED                                                                                [ 65%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_get PASSED                                                                                [ 66%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_gzip <- test/target_test.py PASSED                                                                                [ 66%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_gzip_works_and_cleans_up <- test/target_test.py PASSED                                                                                [ 67%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_put PASSED                                                                                [ 68%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_read_iterator <- test/target_test.py PASSED                                                                                [ 69%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_readback <- test/target_test.py PASSED                                                                                [ 69%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_text <- test/target_test.py PASSED                                                                                [ 70%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_unicode_obj <- test/target_test.py PASSED                                                                                [ 71%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_with_close <- test/target_test.py PASSED                                                                                [ 72%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_with_exception <- test/target_test.py PASSED                                                                                [ 72%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_write_cleanup_no_close <- test/target_test.py PASSED                                                                                [ 73%]
test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_writelines <- test/target_test.py PASSED                                                                                [ 74%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_atomicity <- test/target_test.py PASSED                                                                                [ 75%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_binary_write <- test/target_test.py PASSED                                                                                [ 75%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_del <- test/target_test.py PASSED                                                                                [ 76%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_del_with_Text <- test/target_test.py PASSED                                                                                [ 77%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_format_injection <- test/target_test.py PASSED                                                                                [ 78%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_get PASSED                                                                                [ 78%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_gzip <- test/target_test.py PASSED                                                                                [ 79%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_gzip_works_and_cleans_up <- test/target_test.py PASSED                                                                                [ 80%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_put PASSED                                                                                [ 81%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_read_iterator <- test/target_test.py PASSED                                                                                [ 81%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_readback <- test/target_test.py PASSED                                                                                [ 82%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_text <- test/target_test.py PASSED                                                                                [ 83%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_unicode_obj <- test/target_test.py PASSED                                                                                [ 84%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_with_close <- test/target_test.py PASSED                                                                                [ 84%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_with_exception <- test/target_test.py PASSED                                                                                [ 85%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_write_cleanup_no_close <- test/target_test.py PASSED                                                                                [ 86%]
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_writelines <- test/target_test.py PASSED                                                                                [ 87%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_atomicity <- test/target_test.py PASSED                                                                                [ 87%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_binary_write <- test/target_test.py PASSED                                                                                [ 88%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_del <- test/target_test.py PASSED                                                                                [ 89%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_del_with_Text <- test/target_test.py PASSED                                                                                [ 90%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_format_injection <- test/target_test.py PASSED                                                                                [ 90%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_get PASSED                                                                                [ 91%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_gzip <- test/target_test.py PASSED                                                                                [ 92%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_gzip_works_and_cleans_up <- test/target_test.py PASSED                                                                                [ 93%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_put PASSED                                                                                [ 93%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_read_iterator <- test/target_test.py PASSED                                                                                [ 94%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_readback <- test/target_test.py PASSED                                                                                [ 95%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_text <- test/target_test.py PASSED                                                                                [ 96%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_unicode_obj <- test/target_test.py PASSED                                                                                [ 96%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_with_close <- test/target_test.py PASSED                                                                                [ 97%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_with_exception <- test/target_test.py PASSED                                                                                [ 98%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_write_cleanup_no_close <- test/target_test.py PASSED                                                                                [ 99%]
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_writelines <- test/target_test.py PASSED                                                                                [100%]

============================================================================================================= warnings summary =============================================================================================================
luigi/__init__.py:84
  /n/nvme1/nstinus/src/luigi/luigi/__init__.py:84: DeprecationWarning:
          Autoloading range tasks by default has been deprecated and will be removed in a future version.
          To get the behavior now add an option to luigi.cfg:

            [core]
              autoload_range: false

          Alternately set the option to true to continue with existing behaviour and suppress this warning.

    warnings.warn(warning_message, DeprecationWarning)

test/notifications_test.py:41
  /n/nvme1/nstinus/src/luigi/test/notifications_test.py:41: PytestCollectionWarning: cannot collect test class 'TestException' because it has a __init__ constructor (from: test/notifications_test.py)
    class TestException(Exception):

test/notifications_test.py:45
  /n/nvme1/nstinus/src/luigi/test/notifications_test.py:45: PytestCollectionWarning: cannot collect test class 'TestTask' because it has a __init__ constructor (from: test/notifications_test.py)
    class TestTask(luigi.Task):

test/target_test.py:27
  /n/nvme1/nstinus/src/luigi/test/target_test.py:27: PytestCollectionWarning: cannot collect test class 'TestException' because it has a __init__ constructor (from: test/target_test.py)
    class TestException(Exception):

test/visible_parameters_test.py:7
  /n/nvme1/nstinus/src/luigi/test/visible_parameters_test.py:7: PytestCollectionWarning: cannot collect test class 'TestTask1' because it has a __init__ constructor (from: test/visible_parameters_test.py)
    class TestTask1(luigi.Task):

test/visible_parameters_test.py:13
  /n/nvme1/nstinus/src/luigi/test/visible_parameters_test.py:13: PytestCollectionWarning: cannot collect test class 'TestTask2' because it has a __init__ constructor (from: test/visible_parameters_test.py)
    class TestTask2(luigi.Task):

test/visible_parameters_test.py:19
  /n/nvme1/nstinus/src/luigi/test/visible_parameters_test.py:19: PytestCollectionWarning: cannot collect test class 'TestTask3' because it has a __init__ constructor (from: test/visible_parameters_test.py)
    class TestTask3(luigi.Task):

test/visible_parameters_test.py:25
  /n/nvme1/nstinus/src/luigi/test/visible_parameters_test.py:25: PytestCollectionWarning: cannot collect test class 'TestTask4' because it has a __init__ constructor (from: test/visible_parameters_test.py)
    class TestTask4(luigi.Task):

test/worker_external_task_test.py:28
  /n/nvme1/nstinus/src/luigi/test/worker_external_task_test.py:28: PytestCollectionWarning: cannot collect test class 'TestExternalFileTask' because it has a __init__ constructor (from: test/worker_external_task_test.py)
    class TestExternalFileTask(luigi.ExternalTask):

test/worker_external_task_test.py:52
  /n/nvme1/nstinus/src/luigi/test/worker_external_task_test.py:52: PytestCollectionWarning: cannot collect test class 'TestTask' because it has a __init__ constructor (from: test/worker_external_task_test.py)
    class TestTask(luigi.Task):

test/contrib/beam_dataflow_test.py:48
  /n/nvme1/nstinus/src/luigi/test/contrib/beam_dataflow_test.py:48: PytestCollectionWarning: cannot collect test class 'TestRequires' because it has a __init__ constructor (from: test/contrib/beam_dataflow_test.py)
    class TestRequires(luigi.ExternalTask):

test/contrib/external_program_test.py:49
  /n/nvme1/nstinus/src/luigi/test/contrib/external_program_test.py:49: PytestCollectionWarning: cannot collect test class 'TestExternalProgramTask' because it has a __init__ constructor (from: test/contrib/external_program_test.py)
    class TestExternalProgramTask(ExternalProgramTask):

test/contrib/external_program_test.py:57
  /n/nvme1/nstinus/src/luigi/test/contrib/external_program_test.py:57: PytestCollectionWarning: cannot collect test class 'TestLogStderrOnFailureOnlyTask' because it has a __init__ constructor (from: test/contrib/external_program_test.py)
    class TestLogStderrOnFailureOnlyTask(TestExternalProgramTask):

test/contrib/external_program_test.py:61
  /n/nvme1/nstinus/src/luigi/test/contrib/external_program_test.py:61: PytestCollectionWarning: cannot collect test class 'TestTouchTask' because it has a __init__ constructor (from: test/contrib/external_program_test.py)
    class TestTouchTask(ExternalProgramTask):

test/contrib/external_program_test.py:71
  /n/nvme1/nstinus/src/luigi/test/contrib/external_program_test.py:71: PytestCollectionWarning: cannot collect test class 'TestEchoTask' because it has a __init__ constructor (from: test/contrib/external_program_test.py)
    class TestEchoTask(ExternalProgramTask):

test/contrib/external_program_test.py:288
  /n/nvme1/nstinus/src/luigi/test/contrib/external_program_test.py:288: PytestCollectionWarning: cannot collect test class 'TestExternalPythonProgramTask' because it has a __init__ constructor (from: test/contrib/external_program_test.py)
    class TestExternalPythonProgramTask(ExternalPythonProgramTask):

test/contrib/hadoop_jar_test.py:27
  /n/nvme1/nstinus/src/luigi/test/contrib/hadoop_jar_test.py:27: PytestCollectionWarning: cannot collect test class 'TestHadoopJarJob' because it has a __init__ constructor (from: test/contrib/hadoop_jar_test.py)
    class TestHadoopJarJob(HadoopJarJobTask):

test/contrib/hadoop_jar_test.py:34
  /n/nvme1/nstinus/src/luigi/test/contrib/hadoop_jar_test.py:34: PytestCollectionWarning: cannot collect test class 'TestMissingJarJob' because it has a __init__ constructor (from: test/contrib/hadoop_jar_test.py)
    class TestMissingJarJob(HadoopJarJobTask):

test/contrib/hadoop_jar_test.py:38
  /n/nvme1/nstinus/src/luigi/test/contrib/hadoop_jar_test.py:38: PytestCollectionWarning: cannot collect test class 'TestRemoteHadoopJarJob' because it has a __init__ constructor (from: test/contrib/hadoop_jar_test.py)
    class TestRemoteHadoopJarJob(TestHadoopJarJob):

test/contrib/hadoop_jar_test.py:43
  /n/nvme1/nstinus/src/luigi/test/contrib/hadoop_jar_test.py:43: PytestCollectionWarning: cannot collect test class 'TestRemoteMissingJarJob' because it has a __init__ constructor (from: test/contrib/hadoop_jar_test.py)
    class TestRemoteMissingJarJob(TestHadoopJarJob):

test/contrib/hadoop_jar_test.py:48
  /n/nvme1/nstinus/src/luigi/test/contrib/hadoop_jar_test.py:48: PytestCollectionWarning: cannot collect test class 'TestRemoteHadoopJarTwoParamJob' because it has a __init__ constructor (from: test/contrib/hadoop_jar_test.py)
    class TestRemoteHadoopJarTwoParamJob(TestRemoteHadoopJarJob):

test/contrib/hdfs_test.py:44
  /n/nvme1/nstinus/src/luigi/test/contrib/hdfs_test.py:44: PytestCollectionWarning: cannot collect test class 'TestException' because it has a __init__ constructor (from: test/contrib/hdfs_test.py)
    class TestException(Exception):

test/contrib/lsf_test.py:58
  /n/nvme1/nstinus/src/luigi/test/contrib/lsf_test.py:58: PytestCollectionWarning: cannot collect test class 'TestJobTask' because it has a __init__ constructor (from: test/contrib/lsf_test.py)
    class TestJobTask(LSFJobTask):

.tox/py39-contrib/lib/python3.8/site-packages/bson/codec_options.py:19
  /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/lib/python3.8/site-packages/bson/codec_options.py:19: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
    from collections import MutableMapping, namedtuple

.tox/py39-contrib/lib/python3.8/site-packages/bson/__init__.py:58
  /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/lib/python3.8/site-packages/bson/__init__.py:58: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
    from bson import _cbson

.tox/py39-contrib/lib/python3.8/site-packages/pymongo/monitoring.py:140
  /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/lib/python3.8/site-packages/pymongo/monitoring.py:140: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.10 it will stop working
    from collections import namedtuple, Sequence

.tox/py39-contrib/lib/python3.8/site-packages/past/builtins/misc.py:45
  /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    from imp import reload

test/contrib/salesforce_test.py:82
  /n/nvme1/nstinus/src/luigi/test/contrib/salesforce_test.py:82: PytestCollectionWarning: cannot collect test class 'TestQuerySalesforce' because it has a __init__ constructor (from: test/contrib/salesforce_test.py)
    class TestQuerySalesforce(QuerySalesforce):

test/contrib/sge_test.py:64
  /n/nvme1/nstinus/src/luigi/test/contrib/sge_test.py:64: PytestCollectionWarning: cannot collect test class 'TestJobTask' because it has a __init__ constructor (from: test/contrib/sge_test.py)
    class TestJobTask(SGEJobTask):

test/contrib/spark_test.py:50
  /n/nvme1/nstinus/src/luigi/test/contrib/spark_test.py:50: PytestCollectionWarning: cannot collect test class 'TestSparkSubmitTask' because it has a __init__ constructor (from: test/contrib/spark_test.py)
    class TestSparkSubmitTask(SparkSubmitTask):

test/contrib/spark_test.py:82
  /n/nvme1/nstinus/src/luigi/test/contrib/spark_test.py:82: PytestCollectionWarning: cannot collect test class 'TestDefaultSparkSubmitTask' because it has a __init__ constructor (from: test/contrib/spark_test.py)
    class TestDefaultSparkSubmitTask(SparkSubmitTask):

test/contrib/spark_test.py:89
  /n/nvme1/nstinus/src/luigi/test/contrib/spark_test.py:89: PytestCollectionWarning: cannot collect test class 'TestPySparkTask' because it has a __init__ constructor (from: test/contrib/spark_test.py)
    class TestPySparkTask(PySparkTask):

test/contrib/spark_test.py:101
  /n/nvme1/nstinus/src/luigi/test/contrib/spark_test.py:101: PytestCollectionWarning: cannot collect test class 'TestPySparkSessionTask' because it has a __init__ constructor (from: test/contrib/spark_test.py)
    class TestPySparkSessionTask(PySparkTask):

test/contrib/external_program_test.py::ExternalProgramTaskTest::test_handle_failed_job
  /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/lib/python3.8/site-packages/mock/mock.py:1979: ResourceWarning: unclosed file <_io.BufferedRandom name=14>
    these_magics = these_magics - set(type(self).__dict__)

test/contrib/lsf_test.py::TestSGEJob::test_run_job_with_dump
  /n/nvme1/nstinus/src/luigi/luigi/contrib/lsf.py:217: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/0592ab08fd61d850TestJobTask__1__69e545f261/job-instance.pickle' mode='w' encoding='UTF-8'>
    pickle.dump(self, open(self.job_file, "w"))

test/contrib/scalding_test.py::ScaldingTest::test_scalding
  /n/nvme1/nstinus/src/luigi/luigi/contrib/scalding.py:132: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/scalding-033683821/my_source.scala' mode='r' encoding='UTF-8'>
    for line in open(source).readlines():

test/contrib/sge_test.py::TestSGEJob::test_run_job_with_dump
  /n/nvme1/nstinus/src/luigi/luigi/parameter.py:287: UserWarning: Parameter "job_name_format" with value "None" is not of type string.
    warnings.warn('Parameter "{}" with value "{}" is not of type string.'.format(param_name, param_value))

test/contrib/sge_test.py::TestSGEJob::test_run_job_with_dump
  /n/nvme1/nstinus/src/luigi/luigi/parameter.py:287: UserWarning: Parameter "job_name" with value "None" is not of type string.
    warnings.warn('Parameter "{}" with value "{}" is not of type string.'.format(param_name, param_value))

test/contrib/test_ssh.py::TestGetAttrRecursion::test_recursion_on_delete
  /n/nvme1/nstinus/src/luigi/.tox/py39-contrib/lib/python3.8/site-packages/_pytest/unraisableexception.py:78: PytestUnraisableExceptionWarning: Exception ignored in: <function AtomicRemoteFileWriter.__del__ at 0x7f56db9715e0>

  luigi.contrib.ssh.RemoteCalledProcessError: Command '['mkdir', '-p', '/etc/this/does/not']' on host localhost returned non-zero exit status 1

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/n/nvme1/nstinus/src/luigi/luigi/format.py", line 233, in __getattr__
      return getattr(self._process.stdin, name)
    File "/n/nvme1/nstinus/src/luigi/luigi/format.py", line 231, in __getattr__
      raise AttributeError(name)
  AttributeError: _process

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "/n/nvme1/nstinus/src/luigi/luigi/contrib/ssh.py", line 293, in __del__
      super(AtomicRemoteFileWriter, self).__del__()
    File "/n/nvme1/nstinus/src/luigi/luigi/format.py", line 206, in __del__
      if not self.closed:
    File "/n/nvme1/nstinus/src/luigi/luigi/format.py", line 235, in __getattr__
      return getattr(self._output_pipe, name)
    File "/n/nvme1/nstinus/src/luigi/luigi/format.py", line 231, in __getattr__
      raise AttributeError(name)
  AttributeError: _output_pipe

    warnings.warn(pytest.PytestUnraisableExceptionWarning(msg))

test/contrib/test_ssh.py::TestRemoteTargetAtomicity::test_get
test/contrib/test_ssh.py::TestRemoteTargetCreateDirectories::test_get
test/contrib/test_ssh.py::TestRemoteTargetRelative::test_get
  /spare/local/condacem/.conda/latour/1c2e83718b2d043421fda68d16d02dfc/lib/python3.8/unittest/case.py:633: ResourceWarning: unclosed file <_io.TextIOWrapper name='/tmp/local_luigi_remote_atomic_test.txt' mode='r' encoding='UTF-8'>
    method()

-- Docs: https://docs.pytest.org/en/stable/warnings.html

---------- coverage: platform linux, python 3.8.10-final-0 -----------
Name                                       Stmts   Miss  Cover
--------------------------------------------------------------
luigi/__main__.py                              3      3     0%
luigi/__meta__.py                              6      0   100%
luigi/batch_notifier.py                      137    101    26%
luigi/cmdline.py                              26     20    23%
luigi/cmdline_parser.py                       69      4    94%
luigi/configuration/base_parser.py            16      1    94%
luigi/configuration/cfg_parser.py            108     31    71%
luigi/configuration/core.py                   42      9    79%
luigi/configuration/toml_parser.py            57     35    39%
luigi/contrib/azureblob.py                   144     97    33%
luigi/contrib/batch.py                        84     53    37%
luigi/contrib/beam_dataflow.py               257    151    41%
luigi/contrib/bigquery.py                    351    199    43%
luigi/contrib/bigquery_avro.py                55     38    31%
luigi/contrib/datadog_metric.py               81     54    33%
luigi/contrib/dataproc.py                    124    124     0%
luigi/contrib/docker_runner.py               118     82    31%
luigi/contrib/dropbox.py                     183    183     0%
luigi/contrib/ecs.py                          70     43    39%
luigi/contrib/esindex.py                     150     91    39%
luigi/contrib/external_daily_snapshot.py      29     18    38%
luigi/contrib/external_program.py            136      3    98%
luigi/contrib/ftp.py                         227    227     0%
luigi/contrib/gcp.py                          18     11    39%
luigi/contrib/gcs.py                         267    192    28%
luigi/contrib/hadoop.py                      585    422    28%
luigi/contrib/hadoop_jar.py                   77     46    40%
luigi/contrib/hdfs/abstract_client.py         38     12    68%
luigi/contrib/hdfs/clients.py                 28     11    61%
luigi/contrib/hdfs/config.py                  42     21    50%
luigi/contrib/hdfs/error.py                    8      5    38%
luigi/contrib/hdfs/format.py                 116     71    39%
luigi/contrib/hdfs/hadoopcli_clients.py      169    132    22%
luigi/contrib/hdfs/target.py                  97     71    27%
luigi/contrib/hdfs/webhdfs_client.py          79     45    43%
luigi/contrib/hive.py                        282    190    33%
luigi/contrib/kubernetes.py                  175    115    34%
luigi/contrib/lsf.py                         158     98    38%
luigi/contrib/lsf_runner.py                   39     26    33%
luigi/contrib/mongodb.py                      64     40    38%
luigi/contrib/mrrunner.py                     42     28    33%
luigi/contrib/mssqldb.py                      48     48     0%
luigi/contrib/mysqldb.py                      99     78    21%
luigi/contrib/opener.py                       83      2    98%
luigi/contrib/pai.py                         148     83    44%
luigi/contrib/pig.py                         116     83    28%
luigi/contrib/postgres.py                    192    135    30%
luigi/contrib/presto.py                      160     84    48%
luigi/contrib/prometheus_metric.py            28      1    96%
luigi/contrib/pyspark_runner.py               66     66     0%
luigi/contrib/rdbms.py                       136     60    56%
luigi/contrib/redis_store.py                  30     30     0%
luigi/contrib/redshift.py                    291    182    37%
luigi/contrib/s3.py                          375    274    27%
luigi/contrib/salesforce.py                  335    208    38%
luigi/contrib/scalding.py                    155     26    83%
luigi/contrib/sge.py                         133     29    78%
luigi/contrib/sge_runner.py                   40     30    25%
luigi/contrib/simulate.py                     41     25    39%
luigi/contrib/spark.py                       239    134    44%
luigi/contrib/sparkey.py                      20     20     0%
luigi/contrib/sqla.py                        127      7    94%
luigi/contrib/ssh.py                         206     27    87%
luigi/contrib/target.py                       32      0   100%
luigi/contrib/webhdfs.py                      51     51     0%
luigi/date_interval.py                       142     84    41%
luigi/db_task_history.py                     143     89    38%
luigi/event.py                                13      0   100%
luigi/execution_summary.py                   271     96    65%
luigi/format.py                              314    102    68%
luigi/freezing.py                             32     18    44%
luigi/interface.py                            90     10    89%
luigi/local_target.py                        113     52    54%
luigi/lock.py                                 78     67    14%
luigi/metrics.py                              62     21    66%
luigi/mock.py                                 97     25    74%
luigi/notifications.py                       165     94    43%
luigi/parameter.py                           485    198    59%
luigi/process.py                              64     64     0%
luigi/retcodes.py                             39     25    36%
luigi/rpc.py                                 102     63    38%
luigi/scheduler.py                          1071    463    57%
luigi/server.py                              205    141    31%
luigi/setup_logging.py                        97     50    48%
luigi/target.py                              100     33    67%
luigi/task.py                                337     90    73%
luigi/task_history.py                         33      9    73%
luigi/task_register.py                       122     32    74%
luigi/task_status.py                           9      0   100%
luigi/tools/deps.py                           58     58     0%
luigi/tools/deps_tree.py                      34     34     0%
luigi/tools/luigi_grep.py                     58     58     0%
luigi/tools/range.py                         331    219    34%
luigi/util.py                                113     58    49%
luigi/worker.py                              697    253    64%
--------------------------------------------------------------
TOTAL                                      13383   7292    46%

================================================================================ 133 passed, 11 skipped, 1693 deselected, 42 warnings in 192.06s (0:03:12) =================================================================================
_________________________________________________________________________________________________________________ summary __________________________________________________________________________________________________________________
  py39-contrib: commands succeeded
  congratulations :)

The impact here would be to the contrib test package. I'm not sure that is auto-ran by Github Actions. I may need to pull this branch and check on the local execution of those unittests (which might actually have more broken. We don't run 100% of the tests by default for speed reasons.
It may be worth revisiting that all tests are at least run through CI on the latest supported python version (a future improvement).

Now that we know unittests pass, we'll need to update the setup reference to actually create the installation dep version update:
https://github.com/spotify/luigi/blob/master/setup.py#L103

@nstinus, Now that we know unittests pass, we'll need to update the setup reference to actually create the installation dep version update: https://github.com/spotify/luigi/blob/master/setup.py#L103
Done: https://github.com/spotify/luigi/commit/b51afedc05402bf6829d18d4d6e63c910e3432ab

authors: dlstadther nstinus

repo: spotify/luigi


text:
encrypt.fail-on-error Ignored by DecryptEnvironmentPostProcessor

ISSUE
Old behavior - Hoxton, Greenwich, Finchley...
The old EnvironmentDecryptApplicationInitializer bean creation process took into account the encrypt.fail-on-error property by calling setFailOnError:
EncryptionBootstrapConfiguration
	@Bean
	public EnvironmentDecryptApplicationInitializer environmentDecryptApplicationListener(
			ConfigurableApplicationContext context, KeyProperties keyProperties) {
		TextEncryptor encryptor;
		try {
			encryptor = context.getBean(TextEncryptor.class);
		}
		catch (NoSuchBeanDefinitionException e) {
			encryptor = new FailsafeTextEncryptor();
		}
		EnvironmentDecryptApplicationInitializer listener = new EnvironmentDecryptApplicationInitializer(encryptor);
		listener.setFailOnError(keyProperties.isFailOnError());
		return listener;
	}

Current behavior - 2020.0.0
The new DecryptEnvironmentPostProcessor however doesn't make use of a custom initialization/creation, and by the time it tries to decrypt all the encrypted properties, the value of AbstractEnvironmentDecrypt#failOnError attribute has its default value (true).
As opposed to the previous implementation, It creates the text encryptor on the fly right before decrypting the properties (methods DecryptEnvironmentPostProcessor#postProcessEnvironment & DecryptEnvironmentPostProcessor#getTextEncryptor) but misses to call setFailOnError with the keyProperties.isFailOnError() value.
Then, of course, when decrypting with a no/wrong key, it throws the exception even when encrypt.fail-on-error is set to false.
AbstractEnvironmentDecrypt
	protected String decrypt(TextEncryptor encryptor, String key, String original) {
		String value = original.substring(ENCRYPTED_PROPERTY_PREFIX.length());
		try {
			value = encryptor.decrypt(value);
			if (logger.isDebugEnabled()) {
				logger.debug("Decrypted: key=" + key);
			}
			return value;
		}
		catch (Exception e) {
			String message = "Cannot decrypt: key=" + key;
			if (logger.isDebugEnabled()) {
				logger.warn(message, e);
			}
			else {
				logger.warn(message);
			}
			if (this.failOnError) {
				throw new IllegalStateException(message, e);
			}
			return "";
		}
	}

SUGGESTION
The fix could be based on:

Creating a DecryptEnvironmentPostProcessor default constructor, performing the configuration in the same fashion as the old EnvironmentDecryptApplicationInitializer (calling setFailOnError and creating the encryptors)
Hooking into the DecryptEnvironmentPostProcessor#getTextEncryptor and calling setFailOnError

It would need to be the 2nd option. AbstractEnvironmentDecrypt already has a setFailOnError() method.

It would need to be the 2nd option. AbstractEnvironmentDecrypt already has a setFailOnError() method.

@spencergibb, I´ll submit a PR by today, if ok for you?

@spencergibb, I´ll submit a PR by today, if ok for you?

Sorry @agisbert, I already had a fix and was just running a build.

Sorry @agisbert, I already had a fix and was just running a build.

source: gharchive/issue

authors: agisbert spencergibb

repo: spring-cloud/spring-cloud-commons

license_type: permissive

license_source: bigquery


text:
Support for Google Cloud Source does not work

Describe the bug
Using a fresh new project from start.spring.io:
Java version: 17
Select: org.springframework.boot:spring spring-boot-starter-parent:2.7.5
Add dependencies for: spring-cloud-config-server (Spring Cloud 2021.0.4 by default)
I configured my application.yaml as:
spring:
  application:
    name: config-service
  cloud:
    config:
      server:
        git:
          uri: https://source.developers.google.com/p/my-gcp-project-name/r/config-repo
          clone-on-start: true

following the directions from here.
when running this inside of a GKE cluster the application fails with:
org.eclipse.jgit.api.errors.TransportException: https://source.developers.google.com/p/my-gcp-proyect/r/config-repo: 400 Bad Request at
org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:224)
~[org.eclipse.jgit-5.13.1.202206130422-r.jar:5.13.1.202206130422-r] at
org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:311)
~[org.eclipse.jgit-5.13.1.202206130422-r.jar:5.13.1.202206130422-r] at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:182)
~[org.eclipse.jgit-5.13.1.202206130422-r.jar:5.13.1.202206130422-r] at
org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.cloneToBasedir(JGitEnvironmentRepository.java:651) ~[spring-cloud-config-server-3.1.4.jar:3.1.4] at
org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.initClonedRepository(JGitEnvironmentRepository.java:356) ~[spring-cloud-config-server-3.1.4.jar:3.1.4] at
org.springframework.cloud.config.server.environment.JGitEnvironmentRepository.afterPropertiesSet(JGitEnvironmentRepository.java:277) ~[spring-cloud-config-server-3.1.4.jar:3.1.4] at
org.springframework.cloud.config.server.environment.MultipleJGitEnvironmentRepository.afterPropertiesSet(MultipleJGitEnvironmentRepository.java:66) ~[spring-cloud-config-server-3.1.4.jar:3.1.4]
...
Caused by: org.eclipse.jgit.errors.TransportException: https://source.developers.google.com/p/my-gcp-proyect/r/config-repo: 400 Bad Request at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:719)

I've also tried adding com.google.auth:google-auth-library-oauth2-http as a dependency

Does it work when running outside of GKE?

I did not get a chance to test, since outside the running instance I don't have the proper credentials, I can try and experiment  running locally with imported creds.

Hard to say, but if we could determine if its only a problem on GKE, that would help.

Let me run some experiments and report back!

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

authors: Alos ryanjbaxter spring-cloud-issues

repo: spring-cloud/spring-cloud-config


text:
NoSuchBeanDefinitionException No qualifying bean of type 'org.springframework.core.env.ConfigurableEnvironment'

application.yml
server:   port: 8080 spring:   application:     name: gateway-service   cloud:     gateway:       discovery:         locator:           enabled: true #是否与服务发现组件进行结合，通过 serviceId(必须设置成大写) 转发到具体的服务实例。默认为false，设为true便开启通过服务中心的自动根据 serviceId 创建路由的功能。
throw NoSuchBeanDefinitionException like No qualifying bean of type 'org.springframework.core.env.ConfigurableEnvironment'

Please learn how to format code on GitHub.
Can you provide a complete, minimal, verifiable sample that reproduces the problem? It should be available as a GitHub (or similar) project or attached to this issue as a zip file.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

authors: 136759790 ryanjbaxter spencergibb

repo: spring-cloud/spring-cloud-gateway

license_source: github-api


text:
Lack of alternative for spring-cloud-kubernetes-config without (presumably deprecated) bootstrap.yml and lack of documentation for migrating it

I am a good citizen developer, and I realised spring-cloud-starter-kubernetes-fabric8-config does not include spring-cloud-bootstrap anymore in latest migration.  I could have added it again, but I wanted to check the reason and it seems bootstrap.yml mechanism is now deprecated and Spring Cloud ConfigData API is now expected as the way to do things, as you know.
I spent quite a lot of time reading, and then I see that most people translates ConfigData API to a conventional Vault Hashicorp third-party app that must be installed in the cluster. Too much of an arch change for just making the code of my app compliant with latest expectations. Then I read that you can have a ConfigData API server embedded in the app itself if you use @EnableConfigServer, but I don't see any info on how to bind it to Kubernetes. Looks like it implies git as a source?
Instead I find out spring-cloud-kubernetes-configserver project but it is not clear if it can be used as an autoembedded server.
Finally I go back to https://docs.spring.io/spring-cloud-kubernetes/docs/current/reference/html/, in hopes of finding an alternative  usage that does not rely on bootstrap.yml but here there's no references to our use case. Boostrap.yml is referred all the time.
So, in risk of you considering this ticket as a veiled support request, I really do believe there should be a clear centralized guidance  on the simple way to migrate the old simple spring-cloud-kubernetes-config usage in the most simple compliant non-bootastrap.yaml way, without third-party servers (if that is possible). This business case is absolutely a must especially for Spring Cloud Dataflow Tasks, since we don't manage the deployment and sometimes we need them to "see" configmaps/servers. On a regular app we can manage their deployment.ymls to control the mounts. Deploying a configmap/secret manager component for a few tasks seems like an overkill, we really had no problem with them so far

Hi Ryan!
I seem to understand the deprecation here

https://spring.io/blog/2020/10/07/spring-cloud-2020-0-0-m4-aka-ilford-is-available where it is stated
(The bootstrap phase is no longer enabled by default. If your project requires it, it can be re-enabled (...) spring.config.use-legacy-processing=true. (...) To do this without boostrap see the new features in Config, Consul, Vault and Zookeeper.)
Here the change that motivated the removal of boostrap on sc-k8s-config https://github.com/spring-cloud/spring-cloud-kubernetes/pull/1002/files# (the title itself "Use ConfigData To Load Configuration From Kubernetes Instead Of Bootstrap" seems to imply the preferred way of doing things is by using ConfigData API)

https://docs.spring.io/spring-cloud-vault/docs/current/reference/html/config-data.html#vault.configdata
https://stackoverflow.com/questions/65063402/why-bootstrap-properties-is-ignored-by-spring-cloud-starter-config
https://stackoverflow.com/questions/64994034/bootstrap-yml-configuration-not-processed-anymore-with-spring-cloud-2020-0 (legacy word is everywhere)
https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#config-first-bootstrap
https://github.com/spring-cloud/spring-cloud-release/wiki/Spring-Cloud-2020.0-Release-Notes#known-issues

So, I understand by your words this is all a big misunderstanding from my side, and despite new ConfigData API and server and the like, using bootstrap  mechanism for kubernetes-config is still perfectly legit as first-option.
I had already read before that part of the doc you sent me but it says:
To enable this functionality you need to set spring.config.import=kubernetes: in your application’s configuration properties. Currently you can not specify a ConfigMap or Secret to load using spring.config.import, by default Spring Cloud Kubernetes will load a ConfigMap and/or Secret based on the spring.application.name property. If spring.application.name is not set it will load a ConfigMap and/or Secret with the name application.
So unless docs are outdated, this means I cannot specifythe name of my configmaps secrets, or list them in precedence order. Besides,
If you would like to load Kubernetes PropertySources during the bootstrap phase like it worked prior to the 3.0.x release you can either add spring-cloud-starter-bootstrap to your application’s classpath or set spring.cloud.bootstrap.enabled=true as an environment variable.
seems to imply that spring.config.import=kubernetes: in order to read configmaps and secrets  can only be used after context initialization, and therefore, its the same as placing the properties in application.yml and not bootstrap.yml, which fails for me because some cm/secret properties are needed as external config with precedence
Either way, I really appreciate your previous response.

So summing up, if the typical scenario where an app attempts to read configmaps/secrets directly from k8s in precedence for @Conditionals and the like (as if it was an env var), has a more preferred/state-of-the-art/simpler/ConvOverConfig way to do things, I'll appreciate hearing it!

Thanks now it all fits!

It is not feasible yet if I am reading from configmap/secrets that have custom names unrelated to my app

You should still be able to specify names of configmaps/secrets as well as which namespace they reside in that you want to include as a property source
https://docs.spring.io/spring-cloud-kubernetes/docs/3.0.4/reference/html/#configmap-propertysource

@ryanjbaxter  But if I don't use bootsrap.yml those are not lodaded in autconfiguration time no?

Nope if you use spring.config.import and specify the names of the confit maps and secrets you want to load via the properties in the documentation those property value should be available via auto configuration

@ryanjbaxter I did a test with a SCDF task setting application.yml as
spring:
config:
import=kubernetes:
main:
cloud-platform: kubernetes
cloud:
kubernetes:
config:
sources:
- name: environment
- name: infrastructure
secrets:
enable-api: true
sources:
- name: environment-secret
- name: infrastructure-secret
..and the result is that as soon as my task initialize it fails when trying to locate the properties
Caused by: java.lang.IllegalArgumentException: Could not resolve placeholder 'X' in value \"${X}
That does not happen if I place all spring.cloud.* properties in bootstrap.yml and enable  spring.cloud.bootstrap.enabled=true

Can you provide a sample that reproduces the problem so I can take a look?

I hope I can find some time, because if I am not wrong, the only way to test this at home is installing a whole Kubernetes cluster locally and configure it which I never did

You can us a lightweight cluster like minikube or kind

Thanks for the update.
spring.cloud.bootstrap.enabled=true must be set as either an environment variable or system property, it needs to be set before we load configuration properties.

Ok, by adding
kubectl create secret generic test-secret --from-literal=test-secret-property=success
echo 'spring.cloud.kubernetes.secrets.enable-api=true' >> src/main/resources/application.properties
echo 'spring.cloud.kubernetes.secrets.name=test-secret' >> src/main/resources/application.properties
and printing @Value("${test-secret-property:none}") String testSecretProperty

looks like it cannot  find the secret, so all those errors I saw on unexpandable @Values were probably due to secrets, not configmaps

Nope sorry, it was my fault, I was missing the update of the role to support secrets
kubectl create role configmap-reader --verb=get,list --resource=configmaps,services

Hi @ryanjbaxter  Found a new cornercase on the following application.yml scenario:
spring:
  config:
    activate:
      on-cloud-platform: kubernetes
    import: "kubernetes:"
  cloud:
    kubernetes:
      config:
        sources:
          - name: myconfigmap     # Contains "mydomain.custom.property: baz"
---

spring:
  main:
    cloud-platform: kubernetes
 mydomain:
   custom:
     property: "foo"  # Comment this and the value from configmap is retrieved

In this case, if mydomain.custom.property is defined in the application.yml as default, it takes precedence over the configmap one. Tested with Boot 3.2.2 and Cloud 2023.0.0

If you switch the order the of the documents does that make a difference?

Right, then it works as expected.
Still, is it by design or a bug?
Thanks a lot @ryanjbaxter !

I double checked the following truth table:
YAML_PROP   CONFIGMAP_PROP         App Runtime Value
                                                                         None
     x                                                                  Yaml
                                      x                                 Configmap
     x                               x                                 Configmap

I am unsure how to interpret that, can you just provide the sample configurations?

I used my project but I provided a sample in https://github.com/spring-cloud/spring-cloud-kubernetes/issues/1491#issuecomment-1870987147
I'll try to explain the test above. Using the following application.yml in that particular order
spring:
  main:
    cloud-platform: kubernetes
 mydomain:
   custom:
     property: "foo"
---
spring:
  config:
    activate:
      on-cloud-platform: kubernetes
    import: "kubernetes:"
  cloud:
    kubernetes:
      config:
        sources:
          - name: myconfigmap     # Contains "mydomain.custom.property: baz"

1.If I dont place mydomain.custom.property in either configmap nor application.yml, then @Value("${mydomain.custom.property}:none") shows "none" in runtime
2.If I dont place mydomain.custom.property in configmap but I do in application.yml, then @Value("${mydomain.custom.property}:none") shows the value from application.yml in runtime
3.If I place mydomain.custom.property in configmap but not in application.yml, then @Value("${mydomain.custom.property}:none") shows the value from the configmap in runtime
4.If I place mydomain.custom.property in configmap AND in application.yml, with different values, then @Value("${mydomain.custom.property}:none") shows the value from the configmap in runtime
Thats the truth table explained

And you believe case 4 above is a bug?

I believe whatever configuration is in the last document in your YAML will take precedence.  So if you have the configmap configuration last and it contains the property mydomain.custom.property it will win.  If you have the configmap first and specify the property mdomain.custom.property last it will take precedence over what is in the configmap.

And you believe case 4 above is a bug?

no, no, after I switched order then everything is as expected for me, as per the explanation of cases I did
The only problem for me was that it feels a bit counterintuitive to require to put that config at the end of the file.
It should not matter whether it is before or after the main config, in my opinion

This situation is a bit different though since the PropertySources that get created are part of the same file.  Spring Boot will read the documents in the file in the order they appear.  So if
  main:
    cloud-platform: kubernetes
mydomain:
  custom:
    property: "foo"

is the first document it will create a PropertySource from this document.  If there is a document that comes after this that specifies confifuration from a Config Map or secret we will create a PropertySource from that and it will be placed after the first PropertySource in the list and will therefor have precedence.  While these are "external configurations" they are treaded more as internal configurations that get loaded from an external source.

authors: nightswimmings ryanjbaxter

repo: spring-cloud/spring-cloud-kubernetes


text:
Spring Social integration with Dex for Kubernetes

Provide implementations of spring social to work with providers such as Dex (Federated OpenIdConnect):
https://github.com/dexidp/dex

spring social is no longer maintained.

authors: salaboy spencergibb


text:
@FeignClient doesn't support Java 8 parameter names in @PathVariables

If you compile with the -parameters flag set [1], then Spring Web is able to pick up the value of the @PathVariable annotation from the name of the parameter itself. If you miss off the value from a @PathVariable in a @FeignClient, then the following exception is thrown at startup:
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.example.SecondService': FactoryBean threw exception on object creation; nested exception is java.lang.IllegalStateException: PathVariable annotation was empty on param 0.
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:175) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.getObjectFromFactoryBean(FactoryBeanRegistrySupport.java:103) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForBeanInstance(AbstractBeanFactory.java:1626) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:254) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:207) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1297) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1263) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1099) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1064) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:835) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:741) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	... 19 common frames omitted
Caused by: java.lang.IllegalStateException: PathVariable annotation was empty on param 0.
	at feign.Util.checkState(Util.java:128) ~[feign-core-9.3.1.jar:na]
	at org.springframework.cloud.netflix.feign.annotation.PathVariableParameterProcessor.processArgument(PathVariableParameterProcessor.java:49) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
	at org.springframework.cloud.netflix.feign.support.SpringMvcContract.processAnnotationsOnParameter(SpringMvcContract.java:237) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
	at feign.Contract$BaseContract.parseAndValidateMetadata(Contract.java:107) ~[feign-core-9.3.1.jar:na]
	at org.springframework.cloud.netflix.feign.support.SpringMvcContract.parseAndValidateMetadata(SpringMvcContract.java:133) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
	at feign.Contract$BaseContract.parseAndValidatateMetadata(Contract.java:64) ~[feign-core-9.3.1.jar:na]
	at feign.ReflectiveFeign$ParseHandlersByName.apply(ReflectiveFeign.java:146) ~[feign-core-9.3.1.jar:na]
	at feign.ReflectiveFeign.newInstance(ReflectiveFeign.java:53) ~[feign-core-9.3.1.jar:na]
	at feign.Feign$Builder.target(Feign.java:209) ~[feign-core-9.3.1.jar:na]
	at org.springframework.cloud.netflix.feign.HystrixTargeter.target(HystrixTargeter.java:36) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
	at org.springframework.cloud.netflix.feign.FeignClientFactoryBean.getObject(FeignClientFactoryBean.java:184) ~[spring-cloud-netflix-core-1.2.3.RELEASE.jar:1.2.3.RELEASE]
	at org.springframework.beans.factory.support.FactoryBeanRegistrySupport.doGetObjectFromFactoryBean(FactoryBeanRegistrySupport.java:168) ~[spring-beans-4.3.5.RELEASE.jar:4.3.5.RELEASE]
	... 30 common frames omitted

Example code:
@FeignClient
public interface SecondService {
    @RequestMapping(method = RequestMethod.GET, value = "/foo/{id}")
    Foo getFoo(@PathVariable String id);

    @RequestMapping(method = RequestMethod.POST, value = "/foo/{id}")
    void updateFoo(@PathVariable String id, Foo foo);
}

[1] e.g.
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <compilerArgs>
                        <arg>-parameters</arg>
                    </compilerArgs>
                </configuration>
            </plugin>

Realised I had forgotten to update the Java compiler options in IntelliJ as well

For anyone stumbling onto this issue, here is another one as to why this doesn't work without the compiler options.

It will never work without them.

authors: cavpollo spencergibb wjam

repo: spring-cloud/spring-cloud-netflix


text:
Eureka peer loses remote registrations after a couple of minutes

This is probably just normal behaviour, but I want to understand it in case someone else gets confused the same way I am. I have a "local,cloud" profile in the "eureka" sample that registers with a remote peer (in PWS). It successfully fetches the remote catalog at first, which is quite useful as it lets me test things locally that depend on services in the remote location without having to run them locally. But then after a minute or two the remote catalog entries disappear and I'm left with only the locally registered servers. I imagine this is something to do with the configuration of the remote eureka (which is the same app running in "cloud" profile).

I can't reproduce this one today. Will keep an eye open for it since I like this pattern.

I can reproduce this:
I have 2 eureka instances all having this configuration:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://user:${eureka.password}@localhost:8761/eureka/,http://user:${eureka.password}@localhost:8762/eureka/,http://user:${eureka.password}@localhost:8763/eureka/
On peer1(8761) I can see all 3 instances: EUREKA 	n/a (3) 	(3) 	UP (3)
On peer2 and peer3: No instances available.
At startup the instances were available on peer2 and peer3.

Closing for lack of feedback.

authors: aivans dsyer spencergibb


text:
gradle build failing when i added compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version: '2.2.0.RELEASE' in dependecies at runtime

gradlew build -stacktrace

Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':runSwaggerJsonGenerator'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:98)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:68)
at org.gradle.api.internal.tasks.execution.SkipUpToDateTaskExecuter.execute(SkipUpToDateTaskExecuter.java:62)
at org.gradle.api.internal.tasks.execution.ValidatingTaskExecuter.execute(ValidatingTaskExecuter.java:58)
at org.gradle.api.internal.tasks.execution.SkipEmptySourceFilesTaskExecuter.execute(SkipEmptySourceFilesTaskExecuter.java:88)
at org.gradle.api.internal.tasks.execution.ResolveTaskArtifactStateTaskExecuter.execute(ResolveTaskArtifactStateTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:54)
at org.gradle.api.internal.tasks.execution.ExecuteAtMostOnceTaskExecuter.execute(ExecuteAtMostOnceTaskExecuter.java:43)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:34)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:236)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker$1.execute(DefaultTaskGraphExecuter.java:228)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:61)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:228)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter$EventFiringTaskWorker.execute(DefaultTaskGraphExecuter.java:215)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.processTask(AbstractTaskPlanExecutor.java:77)
at org.gradle.execution.taskgraph.AbstractTaskPlanExecutor$TaskExecutorWorker.run(AbstractTaskPlanExecutor.java:58)
at org.gradle.execution.taskgraph.DefaultTaskPlanExecutor.process(DefaultTaskPlanExecutor.java:32)
at org.gradle.execution.taskgraph.DefaultTaskGraphExecuter.execute(DefaultTaskGraphExecuter.java:113)
at org.gradle.execution.SelectedTaskExecutionAction.execute(SelectedTaskExecutionAction.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.access$000(DefaultBuildExecuter.java:23)
at org.gradle.execution.DefaultBuildExecuter$1.proceed(DefaultBuildExecuter.java:43)
at org.gradle.execution.DryRunBuildExecutionAction.execute(DryRunBuildExecutionAction.java:32)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:37)
at org.gradle.execution.DefaultBuildExecuter.execute(DefaultBuildExecuter.java:30)
at org.gradle.initialization.DefaultGradleLauncher$RunTasksAction.execute(DefaultGradleLauncher.java:230)
at org.gradle.initialization.DefaultGradleLauncher$RunTasksAction.execute(DefaultGradleLauncher.java:227)
at org.gradle.internal.Transformers$4.transform(Transformers.java:169)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:106)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:56)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:161)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:112)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:95)
at org.gradle.launcher.exec.GradleBuildController.run(GradleBuildController.java:66)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:41)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:26)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:75)
at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:49)
at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:31)
at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
at org.gradle.util.Swapper.swap(Swapper.java:38)
at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:60)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:72)
at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:120)
at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:297)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.StoppableExecutorImpl$1.run(StoppableExecutorImpl.java:46)
Caused by: org.gradle.process.internal.ExecException: A problem occurred starting process 'command 'C:\Program Files\Java\jdk1.8.0_221\bin\java.exe''
at org.gradle.process.internal.DefaultExecHandle.setEndStateInfo(DefaultExecHandle.java:198)
at org.gradle.process.internal.DefaultExecHandle.failed(DefaultExecHandle.java:329)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:86)
... 2 more
Caused by: net.rubygrapefruit.platform.NativeException: Could not start 'C:\Program Files\Java\jdk1.8.0_221\bin\java.exe'
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:27)
at net.rubygrapefruit.platform.internal.WindowsProcessLauncher.start(WindowsProcessLauncher.java:22)
at net.rubygrapefruit.platform.internal.WrapperProcessLauncher.start(WrapperProcessLauncher.java:36)
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:68)
... 2 more
Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" (in directory "C:\gitcheckout\activities-app-service-impl"): CreateProcess error=206, The filename or extension is too long
at net.rubygrapefruit.platform.internal.DefaultProcessLauncher.start(DefaultProcessLauncher.java:25)
... 5 more
Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
... 6 more

Not sure this had anything to do with this project.

if i remove compile group: 'org.springframework.cloud', name: 'spring-cloud-starter-netflix-eureka-client', version: '2.2.0.RELEASE build is success but if add again build failing

Closing as this has nothing specific to do with this project.
https://github.com/gradle/gradle/issues/1959
https://stackoverflow.com/questions/10519558/createprocess-error-206-the-filename-or-extension-is-too-long-when-running-main

authors: HarshaVardhanAcharyAthaluri spencergibb


text:
spring-cloud-starter-hystrix-dashboard  jquery3.4.1 usage error

Describe the bug
version:
    <spring-cloud.version>Hoxton.SR5</spring-cloud.version>     <hystrix-dashboard.version>2.2.3.RELEASE</hystrix-dashboard.version>
Hoxton.SR5 with query version: 3.4.1，in file: monitor.ftlh，the usage of jquery as follow：
$(window).load(function()
right usage is :
$(window).on("load",function()
Sample
hystrix-dashboard loading, and can not go on..

closing in favor of #3817

authors: spencergibb weissxu


text:
Add global zuul sensitiveHeaders option.

Route specific sensitiveHeaders override global.
fixes gh-944

Closed via df5303912f65c7fb4a40ee73b8f9750a72ac3d1a

source: gharchive/pull-request


text:
Feign client as fallback for Feign client

I'm trying to create feign client with the fallback that is feign client. But I'm getting the exception:

Fallback class must implement the interface annotated by @FeignClient

Example:
@FeignClient(name = "MyClient", url = "http://localhost:8080",         configuration = ClientConfiguration.class,         decode404 = true, fallback = FallbackClient.class) public interface MyClient {      //some methods }
@FeignClient(name =  "FallBackClient", url = "http://localhost:8080",         configuration = FallbackClient.class,         decode404 = true) public interface FallbackClient extends MyClient {      //some methods }
I'm using Spring Boot 2.1.1.RELEASE  and Spring Cloud 2.0.2.RELEASE . In previous versions of spring boot it works perfectly.

Closing as answered

authors: gnupinguin spencergibb

repo: spring-cloud/spring-cloud-openfeign


text:
Document the configuration of relevant properties when connecting to/from existing message-broker infrastructure

@sabbyanandan commented on Fri Jan 25 2019
As a user, I'm attempting to connect to existing Rabbit infrastructure including the predefined exchange/queue resources; however, I'm unable to determine what properties to enable/disable, so the framework doesn't auto-create them differently.
More background in slack conversation here.
Notes:

@garyrussell suggested adding a new section (perhaps: Using SCSt to consume from existing infrastructure (exchange/queue) that could be useful as a reference.
It might also be helpful to define the requirement first, and follow-up with an example in this section.
Probably also clarify this in the context for both Rabbit and Kafka binders.

@garyrussell commented on Fri Jan 25 2019

Probably also clarify this in the context for both Rabbit and Kafka binders.

There's really no complexity with Kafka since the destination is simply the topic name,  but I suppose it won't hurt to mention that.

Closing this issue. Here is PR that added the Rabbit binder docs changes: https://github.com/spring-cloud/spring-cloud-stream-binder-rabbit/pull/240/

authors: sabbyanandan sobychacko


text:
Messages silently discarded due to changed republishToDlq default

In c2ed214, the default value of republishToDlq was changed to true. With our setup, this caused unsuccessfully consumed messages to be silently discarded instead of being sent to the DLQ:

With republishToDlq=false (old behaviour): rabbitmq itself republishes to the DLQ
With republishToDlq=true (new behaviour): spring republishes to the DLQ, but our configured rabbitmq user did not have permissions to send messages to the configured DLX

Additional context: all our Rabbitmq exchanges/queues/bindings/users/permissions are set up up-front, so we do not use any auto declaration or binding. See below for our exact config.
Actionable issues

when republishing to the DLQ fails, the message should not be acked since it causes the message to be lost. With us, the cause was permissions, but we assume this could also be caused by network issues.
changes such as these are currently not documented anywhere (unless we missed this?). However we feel it's quite important to be able to consult some kind of changelog to at least know which areas are impacted by an upgrade (e.g. to retest).

Our config
spring:
  cloud:
    stream:
      bindings:
        input:
          consumer:
            max-attempts: 3
      rabbit:
        bindings:
          input:
            consumer:
              missing-queues-fatal: true
              queue-name-group-only: true
              declare-exchange: false
              bind-queue: false
              requeue-rejected: false
              transacted: true

Related: #292 (but different cause)

Related: #292 (but different cause)

There is a recent change in spring-amqp (2.3.3) that supports waiting for publisher confirms https://docs.spring.io/spring-amqp/docs/current/reference/html/#republishmessagerecoverer-changes - something like that should be added here too.
But that won't work for the @stefnoten because you can't use transactions and publisher confirms on the same channel.
Since you are using transactions, I would have expected the commit to fail; however, I see that the binder unconditionally uses a non-transactional RabbitTemplate to publish to the DLQ, so doesn't participate in the consumer transaction. That's the root cause, here (I think, I haven't tested whether the commit would have failed).

There is a recent change in spring-amqp (2.3.3) that supports waiting for publisher confirms https://docs.spring.io/spring-amqp/docs/current/reference/html/#republishmessagerecoverer-changes - something like that should be added here too.
But that won't work for the @stefnoten because you can't use transactions and publisher confirms on the same channel.
Since you are using transactions, I would have expected the commit to fail; however, I see that the binder unconditionally uses a non-transactional RabbitTemplate to publish to the DLQ, so doesn't participate in the consumer transaction. That's the root cause, here (I think, I haven't tested whether the commit would have failed).

authors: garyrussell stefnoten


text:
Kafka + Websocket bean incompatibility

@MassimilianoPoggi commented on Mon Oct 21 2019
Using Spring Boot 2.2.0.RELEASE and Spring Cloud Hoxton.M3, trying to write an application containing both WebSocket and Cloud Stream Binder Kafka dependencies will result in a bean conflict being raised.
Minimal (non-)working example: https://github.com/MassimilianoPoggi/websocket-kafka-incompatibility
Error displayed when running the application:
***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method messageConversionDelegate in org.springframework.cloud.stream.binder.kafka.streams.KafkaStreamsBinderSupportAutoConfiguration required a single bean, but 2 were found:
        - brokerMessageConverter: defined by method 'brokerMessageConverter' in class path resource [org/springframework/web/socket/config/annotation/DelegatingWebSocketMessageBrokerConfiguration.class]
        - integrationArgumentResolverMessageConverter: defined by method 'configurableCompositeMessageConverter' in class path resource [org/springframework/cloud/stream/config/ContentTypeConfiguration.class]

Action:

Consider marking one of the beans as @Primary, updating the consumer to accept multiple beans, or using @Qualifier to identify the bean that should be consumed

Based on the discussion, it appears this is related to Kafka Streams binder after all. I will move it back again.

repo: spring-cloud/spring-cloud-stream


text:
feat: add assignee downstream in GitHub

Automatic assignment of PR authors to downstream pull requests created by updatebot.
Copilot Summary
This pull request includes several changes to the pkg/apis/updatebot/v1alpha1/types.go and pkg/cmd/pr/pr.go files to enhance the functionality of handling pull request assignees. The most important changes include adding new fields to the Rule struct, updating the Options struct, and introducing new methods for assigning users to pull requests.
Enhancements to pull request handling:

pkg/apis/updatebot/v1alpha1/types.go: Added PullRequestAssignees and AssignAuthorToPullRequests fields to the Rule struct.

Updates to the Options struct:

pkg/cmd/pr/pr.go: Added PipelineCommitSha, PipelineGitUrl, and PRAssignees fields to the Options struct.

New methods for assigning users to pull requests:

pkg/cmd/pr/pr.go: Added FindCommitAuthor method to find the author of a commit.
pkg/cmd/pr/pr.go: Added AssignUserToCommit method to assign users to a pull request.

Additional modifications to support new functionality:

pkg/cmd/pr/pr.go: Updated the Run method to include logic for handling PullRequestAssignees and AssignAuthorToPullRequests. [1] [2]
pkg/cmd/pr/pr.go: Updated the Validate method to set default values for PipelineCommitSha and PipelineGitUrl if they are not provided.

@Skisocks - refactored Run() by stripping back inner logic, with functions doing the heavy lifting. Switched log output to use logger

repo: spring-financial-group/jx-updatebot


text:
Spring AI Ollama does not behaviour like Ollama.

I am writing some blog post on Ollama et Spring AI and I wonder if it's a bug or a bad configuration on my end but when I do a direct on Ollama using llava:34B.
llava-34B-request.json
The answer is always the same it recognizes the text on the image "Hello generative AI Meetup" but the I use Spring AI it's really far from the right answer so I guess Spring AI gives some default parameters that are not the same as the default on Ollama. I would expect the same behaviour.
The spring ai code I use is : https://github.com/mikrethor/spring-ai-llava

Maybe you could try an integration test like this one and check if you still get the same error
models/spring-ai-ollama/src/test/java/org/springframework/ai/ollama/OllamaChatClientIT.java

Hey!  @mikrethor I found this issue while diagnosing a different bug around Ollama+Llava.
The code in your example is referencing a snapshot.
1.0.0-M1 has been released since May. There are a ton of changes.
I think this issue should be closed.  The use case in your example code will work as expected with 1.0.0-M1.
I have a similarly trivial example repository, using 1.0.0-M1 with "llava" here:
https://github.com/javagrunt-com/com.javagrunt.service.cleanchecker
And the repo includes a link to a YouTube video demonstration.
Upgrading is totally worth it!

Thanks @dashaun   Closing the issue.  Please reopen if there is anything we missed.

Just to make sure. I did some stuff with 1.0.0-M4 and it works as expected.

authors: dashaun f3rnandomoreno markpollack mikrethor

repo: spring-projects/spring-ai


text:
Memory leak with AsyncRabbitTemplate

Backport of gh-2673

Fixed via 6e4220f50decf4094ab2d99a6c1ba51aa73d2057

repo: spring-projects/spring-amqp


text:
GH-1339: Fix RLErrorHandler with Conversion Ex.

Resolves https://github.com/spring-projects/spring-amqp/issues/1339
Error handler was not called for conversion exceptions, preventing
the application frm returning some error to the caller for request/reply
processing.
cherry-pick to 2.2.x

... and cherry-picked to 2.2.x

authors: artembilan garyrussell


text:
Use ReactorContext from ThreadLocalAccessor in WebGraphQlHandlerInterceptor

Hi, I want to access the values saved in ReactorContext by my ThreadLocalAccessor impl in a WebGraphQlHandlerInterceptor, but ReactorContextManager save them inside a map using a private Key name and from what i could see there isn't a way for retrieving those values without declaring again the Key name in my project. Am I right? Is there going to be a better way to do this?
As i understood, ThreadLocalAccessor extract and restore Servlet context from/to DataFetchers, what about WebGraphQlHandlerInterceptor? Am i missing something?
Thanks in advance.

I presume that you want to access them as ThreadLocal values? Currently we don't restore context for interceptors but we can do that.

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

Hi again, thank you for answering. I could review the code to better understand what was happening and explain it clearly:
I am using a WebGraphQlHandlerInterceptor to include some values in context with request/response info. For Reactive apps was everything ok, but for Servlet apps i was using ThreadLocal contexts and then notice these can be empty because of changing the execution thread.
Then i used Reactor Context to obtain ThreadLocal context values as i have a ThreadLocalAccessor to save them, but the access to these values is not as easy as expected because they are included in a Map with a key "...ReactorContextManager.THREAD_VALUES_ACCESSOR" which has private access scope. So i had to define this key in my interceptor and read it directly from Context.
I was expecting maybe a public static method in ReactorContextManager to extract that saved map, or even better to extract a value saved with a concrete ThreadLocalAccessor.
About your proposed solution, restoring context for interceptors sounds great but as i understand, thread may change in async interceptors, and saving/restoring contexts in every interceptor doesn't seem optimal, is it?

I'm a bit unclear on what exactly you're trying to achieve.
It sounds to me like you have some Threadlocal values in Spring MVC and you want to use a WebGraphQlInterceptor to add them to the GraphQLContext? I wonder if you need to do that though since those ThreadLocal values are captured and will be restored for data fetchers to access.
If you could please take a step back and explain the use case and what your goal is, without referring to a solution and details like ThreadLocalAccessor or ReactorContext, which are not intended to be used directly by applications.

I'm sorry for being unclear with my explanation.
I want to save something in a ThreadLocal object of mine based on the info of the WebGraphQlResponse (to check if there are errors or not), and for every response (that's important, as i need a solution for any mapping/dataFetcher).
I found that WebGraphQlInterceptor can be useful for this, but as i read here in Spring GraphQl doc an async interceptor in Spring MVC app could change the execution to a different thread, so i can't use ThreadLocal values directly.
Let me know if it's ok up to here or there is something wrong, thanks.

At what layer, level, or component is the ThreadLocal created?
At what layer, level, or component do you want to modify it?
At what layer, level, or component do you want to access it?
Please, be as specific as you can be, e.g. "Servlet filter on the way in", etc.

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

We create the ThreadLocal object in a Servlet filter, we want to modify it in an WebGraphQlHandlerInterceptor based on GraphQl response, and want to access it in another Servlet filter before return statement.

Thanks for the clarification. That makes the scenario clear.
After #459, for the upcoming 1.1 release, you can register a ThreadLocalAccessor with a key, and the ThreadLocal value will be inserted into the Reactor context under that same key. So a WebGraphQlHandlerInterceptor can access this value from the Reactor context and it can also change the value.
Currently, however, we don't update ThreadLocal values after the call to the WebGraphQlHandlerInterceptor chain, which means that the Filter chain won't see any changes on the way out. We could make such a change, or alternatively, you could use WebGraphQlHandlerInterceptor to add HTTP response headers, if that's what you need to do.

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

repo: spring-projects/spring-graphql