{"id":172,"date":"2020-12-11T14:39:29","date_gmt":"2020-12-11T13:39:29","guid":{"rendered":"https:\/\/ptdb.ch\/?p=172"},"modified":"2020-12-11T14:39:29","modified_gmt":"2020-12-11T13:39:29","slug":"postgresql-usr-share-temboard-agent-auto_configure-sh-line-54-used_a-unbound-variable","status":"publish","type":"post","link":"https:\/\/ptdb.ch\/?p=172","title":{"rendered":"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable"},"content":{"rendered":"<p>If you try to deploy a new temBoard Agent (Version temboard-agent-7.4-1.el7.noarch) on RHEL\/CentOS 7, you might end up with the following error:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n$ sudo \/usr\/share\/temboard-agent\/auto_configure.sh https:\/\/host.example.ch:8888\nUsing hostname host.example.ch.\nConfiguring for PostgreSQL user postgres.\nConfiguring for cluster on port 55031.\nConfiguring for cluster at \/app\/lib\/postgres\/pgdata\/12\/P01A.\nConfiguring temboard-agent in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf .\nSaving auto-configuration in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf.d\/auto.conf\nFailure. See \/var\/log\/temboard-agent-auto-configure.log for details.\n<\/pre>\n<p>In the log you will find the following error which point to an unbound variable.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n+++ ss -ln4t '( sport &gt;= 2345 and sport &lt;= 3000 )'\n+++ grep -Po ':\\K\\d+'\n\/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a&#x5B;*]: unbound variable\n+ port=\n+ catchall\n+ '&#x5B;' 1 -gt 0 ']'\n<\/pre>\n<p>A workaround, which worked for me, is to replace the upper port of 3000 with 300000.<\/p>\n<p>Simply change the file \/usr\/share\/temboard-agent\/auto_configure.sh and replace sport &lt;= 3000 with sport &lt;= 300000.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\nFrom\nmapfile -t used_a &lt; &lt;(ss -ln4t '( sport &gt;= 2345 and sport &lt;= 3000 )' | grep -Po ':\\K\\d+')\n\nTo\nmapfile -t used_a &lt; &lt;(ss -ln4t '( sport &gt;= 2345 and sport &lt;= 300000 )' | grep -Po ':\\K\\d+')\n\nfind_next_free_port() {\n        local port\n        local used_a\n        local used\n        mapfile -t used_a &lt; &lt;(ss -ln4t '( sport &gt;= 2345 and sport &lt;= 300000 )' | grep -Po ':\\K\\d+')\n        # To mock ss output, use seq:\n        # mapfile -t used_a &lt; &lt;(seq 2345 3000)\n        used=&quot;${used_a&#x5B;*]}&quot;\n        for port in {2345..3000} ; do\n                if &#x5B;&#x5B; &quot; $used &quot; =~ \\ $port\\  ]] ; then continue ; fi\n                echo $port;\n                return\n        done\n        log &quot;No free TCP port found between 2345 and 3000. Force with env TEMBOARD_PORT.&quot;\n        return 1\n}\n<\/pre>\n<p>Another workaround that you can use, is to replace the line<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nused=&quot;${used_a&#x5B;*]}&quot;\n<\/pre>\n<p>with<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nused=&quot;${used_a&#x5B;*]:-}&quot;\n<\/pre>\n<p>Now the deployment of the new temBoard agent worked. \ud83d\ude42<\/p>\n<h3>Conclusion<\/h3>\n<p>In case you need to deploy a 7.4 temBoard agent quickly, you might want to use these workarounds. The other possibility is to wait for temBoard agent 7.5 until the following bug is fixed. <a href=\"https:\/\/github.com\/dalibo\/temboard-agent\/issues\/507\">https:\/\/github.com\/dalibo\/temboard-agent\/issues\/507<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you try to deploy a new temBoard Agent (Version temboard-agent-7.4-1.el7.noarch) on RHEL\/CentOS 7, you might end up with the following error: $ sudo \/usr\/share\/temboard-agent\/auto_configure.sh https:\/\/host.example.ch:8888 Using hostname host.example.ch. Configuring for PostgreSQL user postgres. Configuring for cluster on port 55031. Configuring for cluster at \/app\/lib\/postgres\/pgdata\/12\/P01A. Configuring temboard-agent in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf . Saving auto-configuration in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf.d\/auto.conf Failure. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ocean_post_layout":"","ocean_both_sidebars_style":"","ocean_both_sidebars_content_width":0,"ocean_both_sidebars_sidebars_width":0,"ocean_sidebar":"","ocean_second_sidebar":"","ocean_disable_margins":"enable","ocean_add_body_class":"","ocean_shortcode_before_top_bar":"","ocean_shortcode_after_top_bar":"","ocean_shortcode_before_header":"","ocean_shortcode_after_header":"","ocean_has_shortcode":"","ocean_shortcode_after_title":"","ocean_shortcode_before_footer_widgets":"","ocean_shortcode_after_footer_widgets":"","ocean_shortcode_before_footer_bottom":"","ocean_shortcode_after_footer_bottom":"","ocean_display_top_bar":"default","ocean_display_header":"default","ocean_header_style":"","ocean_center_header_left_menu":"","ocean_custom_header_template":"","ocean_custom_logo":0,"ocean_custom_retina_logo":0,"ocean_custom_logo_max_width":0,"ocean_custom_logo_tablet_max_width":0,"ocean_custom_logo_mobile_max_width":0,"ocean_custom_logo_max_height":0,"ocean_custom_logo_tablet_max_height":0,"ocean_custom_logo_mobile_max_height":0,"ocean_header_custom_menu":"","ocean_menu_typo_font_family":"","ocean_menu_typo_font_subset":"","ocean_menu_typo_font_size":0,"ocean_menu_typo_font_size_tablet":0,"ocean_menu_typo_font_size_mobile":0,"ocean_menu_typo_font_size_unit":"px","ocean_menu_typo_font_weight":"","ocean_menu_typo_font_weight_tablet":"","ocean_menu_typo_font_weight_mobile":"","ocean_menu_typo_transform":"","ocean_menu_typo_transform_tablet":"","ocean_menu_typo_transform_mobile":"","ocean_menu_typo_line_height":0,"ocean_menu_typo_line_height_tablet":0,"ocean_menu_typo_line_height_mobile":0,"ocean_menu_typo_line_height_unit":"","ocean_menu_typo_spacing":0,"ocean_menu_typo_spacing_tablet":0,"ocean_menu_typo_spacing_mobile":0,"ocean_menu_typo_spacing_unit":"","ocean_menu_link_color":"","ocean_menu_link_color_hover":"","ocean_menu_link_color_active":"","ocean_menu_link_background":"","ocean_menu_link_hover_background":"","ocean_menu_link_active_background":"","ocean_menu_social_links_bg":"","ocean_menu_social_hover_links_bg":"","ocean_menu_social_links_color":"","ocean_menu_social_hover_links_color":"","ocean_disable_title":"default","ocean_disable_heading":"default","ocean_post_title":"","ocean_post_subheading":"","ocean_post_title_style":"","ocean_post_title_background_color":"","ocean_post_title_background":0,"ocean_post_title_bg_image_position":"","ocean_post_title_bg_image_attachment":"","ocean_post_title_bg_image_repeat":"","ocean_post_title_bg_image_size":"","ocean_post_title_height":0,"ocean_post_title_bg_overlay":0.5,"ocean_post_title_bg_overlay_color":"","ocean_disable_breadcrumbs":"default","ocean_breadcrumbs_color":"","ocean_breadcrumbs_separator_color":"","ocean_breadcrumbs_links_color":"","ocean_breadcrumbs_links_hover_color":"","ocean_display_footer_widgets":"default","ocean_display_footer_bottom":"default","ocean_custom_footer_template":"","ocean_post_oembed":"","ocean_post_self_hosted_media":"","ocean_post_video_embed":"","ocean_link_format":"","ocean_link_format_target":"self","ocean_quote_format":"","ocean_quote_format_link":"post","ocean_gallery_link_images":"on","ocean_gallery_id":[],"footnotes":""},"categories":[6,7],"tags":[21,24],"class_list":["post-172","post","type-post","status-publish","format-standard","hentry","category-postgresql","category-red-hat","tag-postgresql","tag-temboard","entry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable - ptdb - Platinum DB<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/ptdb.ch\/?p=172\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable - ptdb - Platinum DB\" \/>\n<meta property=\"og:description\" content=\"If you try to deploy a new temBoard Agent (Version temboard-agent-7.4-1.el7.noarch) on RHEL\/CentOS 7, you might end up with the following error: $ sudo \/usr\/share\/temboard-agent\/auto_configure.sh https:\/\/host.example.ch:8888 Using hostname host.example.ch. Configuring for PostgreSQL user postgres. Configuring for cluster on port 55031. Configuring for cluster at \/app\/lib\/postgres\/pgdata\/12\/P01A. Configuring temboard-agent in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf . Saving auto-configuration in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf.d\/auto.conf Failure. [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/ptdb.ch\/?p=172\" \/>\n<meta property=\"og:site_name\" content=\"ptdb - Platinum DB\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-11T13:39:29+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/ptdb.ch\/?p=172\",\"url\":\"https:\/\/ptdb.ch\/?p=172\",\"name\":\"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable - ptdb - Platinum DB\",\"isPartOf\":{\"@id\":\"https:\/\/ptdb.ch\/#website\"},\"datePublished\":\"2020-12-11T13:39:29+00:00\",\"author\":{\"@id\":\"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b\"},\"breadcrumb\":{\"@id\":\"https:\/\/ptdb.ch\/?p=172#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/ptdb.ch\/?p=172\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/ptdb.ch\/?p=172#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/ptdb.ch\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/ptdb.ch\/#website\",\"url\":\"https:\/\/ptdb.ch\/\",\"name\":\"ptdb - Platinum DB\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/ptdb.ch\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/ptdb.ch\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/ptdb.ch\"],\"url\":\"https:\/\/ptdb.ch\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable - ptdb - Platinum DB","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/ptdb.ch\/?p=172","og_locale":"en_US","og_type":"article","og_title":"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable - ptdb - Platinum DB","og_description":"If you try to deploy a new temBoard Agent (Version temboard-agent-7.4-1.el7.noarch) on RHEL\/CentOS 7, you might end up with the following error: $ sudo \/usr\/share\/temboard-agent\/auto_configure.sh https:\/\/host.example.ch:8888 Using hostname host.example.ch. Configuring for PostgreSQL user postgres. Configuring for cluster on port 55031. Configuring for cluster at \/app\/lib\/postgres\/pgdata\/12\/P01A. Configuring temboard-agent in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf . Saving auto-configuration in \/etc\/temboard-agent\/12\/pg55031\/temboard-agent.conf.d\/auto.conf Failure. [&hellip;]","og_url":"https:\/\/ptdb.ch\/?p=172","og_site_name":"ptdb - Platinum DB","article_published_time":"2020-12-11T13:39:29+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/ptdb.ch\/?p=172","url":"https:\/\/ptdb.ch\/?p=172","name":"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable - ptdb - Platinum DB","isPartOf":{"@id":"https:\/\/ptdb.ch\/#website"},"datePublished":"2020-12-11T13:39:29+00:00","author":{"@id":"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b"},"breadcrumb":{"@id":"https:\/\/ptdb.ch\/?p=172#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/ptdb.ch\/?p=172"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/ptdb.ch\/?p=172#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/ptdb.ch\/"},{"@type":"ListItem","position":2,"name":"PostgreSQL: \/usr\/share\/temboard-agent\/auto_configure.sh: line 54: used_a[*]: unbound variable"}]},{"@type":"WebSite","@id":"https:\/\/ptdb.ch\/#website","url":"https:\/\/ptdb.ch\/","name":"ptdb - Platinum DB","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/ptdb.ch\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/ptdb.ch\/#\/schema\/person\/0b7baf52d23e71d85e1c95442306090b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/ptdb.ch\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/1a3dffc48c5f6bae0b88a9f0b2a986d48d322673fbc2880c5abbfab96e45da8a?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/ptdb.ch"],"url":"https:\/\/ptdb.ch\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/posts\/172","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=172"}],"version-history":[{"count":0,"href":"https:\/\/ptdb.ch\/index.php?rest_route=\/wp\/v2\/posts\/172\/revisions"}],"wp:attachment":[{"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ptdb.ch\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}