Bug 219306 - security/py-certbot: 'tuple' object has no attribute 'add' (configargparse 0.12 regression)
Summary: security/py-certbot: 'tuple' object has no attribute 'add' (configargparse 0....
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Some People
Assignee: Carlos J. Puga Medina
URL: https://github.com/certbot/certbot/co...
Keywords: patch, patch-ready
Depends on:
Blocks:
 
Reported: 2017-05-15 14:00 UTC by Gian-Simon Purkert
Modified: 2017-05-20 20:46 UTC (History)
8 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
patch (3.79 KB, patch)
2017-05-16 07:58 UTC, Carlos J. Puga Medina
no flags Details | Diff
patch (4.21 KB, patch)
2017-05-16 09:47 UTC, Carlos J. Puga Medina
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Gian-Simon Purkert 2017-05-15 14:00:56 UTC
Install from port works fine, but if i run certbot this error occurs:

An unexpected error occurred:
AttributeError: 'tuple' object has no attribute 'add'
Please see the logfile 'certbot.log' for more details.

pip check -> everything ok

Installed Pythons:
Python 2.7.13 (default, May 12 2017, 22:07:08) 
Python 3.6.1 (default, May 14 2017, 11:26:05)
Comment 1 Gian-Simon Purkert 2017-05-15 14:23:59 UTC
#  cat certbot.log

Traceback (most recent call last):
  File "/usr/local/bin/certbot", line 11, in <module>
    load_entry_point('certbot==0.13.0', 'console_scripts', 'certbot')()
  File "/usr/local/lib/python2.7/site-packages/certbot/main.py", line 738, in main
    args = cli.prepare_and_parse_args(plugins, cli_args)
  File "/usr/local/lib/python2.7/site-packages/certbot/cli.py", line 1072, in prepare_and_parse_args
    helpful.add_deprecated_argument("--agree-dev-preview", 0)
  File "/usr/local/lib/python2.7/site-packages/certbot/cli.py", line 726, in add_deprecated_argument
    self.parser.add_argument, argument_name, num_args)
  File "/usr/local/lib/python2.7/site-packages/certbot/util.py", line 440, in add_deprecated_argument
    configargparse.ACTION_TYPES_THAT_DONT_NEED_A_VALUE.add(ShowWarning)
AttributeError: 'tuple' object has no attribute 'add'




I'm sorry for adding this information late
Comment 2 Gian-Simon Purkert 2017-05-15 14:40:09 UTC
Done some search and i think, i could have something todo with this update:

py27-configargparse-0.11.0 to py27-configargparse-0.12.0
Comment 3 Kubilay Kocak freebsd_committer freebsd_triage 2017-05-15 14:53:29 UTC
ports r440849 updated configargparse to 0.12 which appears to cause this issue.

CC'ing committer of that change (sunpoet) and py-acme maintainer (cpm)
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2017-05-15 14:56:02 UTC
Add upstream issue link
Comment 5 Kubilay Kocak freebsd_committer freebsd_triage 2017-05-15 14:58:35 UTC
Commit potentially (unverified) fixing issue: 

https://github.com/certbot/certbot/commit/de1dbb745fd5baec304c59a6a68f794515f7c7e5
Comment 6 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-05-15 19:10:39 UTC
(In reply to Kubilay Kocak from comment #5)

I think it's the solution. Thanks!
I removed the flag because there's nothing to do in configargparse part.
Comment 7 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-05-16 07:58:35 UTC
Created attachment 182620 [details]
patch

Add support version 0.12.0 of configargparse
Comment 8 Kubilay Kocak freebsd_committer freebsd_triage 2017-05-16 09:28:48 UTC
@Carlos Thank you for your patch. Can you please:

1) Add the PR metadata to the header of the patch as a comment (add .patch to pull request URL to see commit metadata):

Pull Request: https://github.com/certbot/certbot/pull/4650
Issue: 
From 42d07d756df0cf96c9d20b44e772858391d48384 Mon Sep 17 00:00:00 2001
From: Ryan Pineo <ry@tsl.io>
Date: Fri, 12 May 2017 15:45:54 -0400
Subject: [PATCH] support version 0.12.0 of configargparse

fixes #4648

2) Confirm the change passes QA
Comment 9 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-05-16 09:47:33 UTC
Created attachment 182625 [details]
patch

- Add the PR metadata to the header of the patches as a comment.
Comment 10 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-05-16 09:55:21 UTC
portlint: OK (looks fine.)
testport: OK (poudriere: 103i386, 103amd64, 110i386, 110amd64, 120i386 and 120amd64.)
unittest: OK (609 tests in 15.967s)
Comment 11 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-05-16 09:56:51 UTC
security/py-acme needs bump PORTREVISION
Comment 13 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-05-19 09:54:08 UTC
(In reply to SBB from comment #12)

I have a patch to update py-{acme,certbot} to 0.14.1 release in Phabricator

https://reviews.freebsd.org/D10612
Comment 14 Kubilay Kocak freebsd_committer freebsd_triage 2017-05-20 02:37:45 UTC
Comment on attachment 182625 [details]
patch

Approved, don't forget missing PORTREVISION for py-acme (not included in patch)
Comment 15 Matthias Fechner freebsd_committer freebsd_triage 2017-05-20 07:02:08 UTC
Thanks, I tested the patches and they fixed the problem.
Comment 16 commit-hook freebsd_committer freebsd_triage 2017-05-20 20:45:03 UTC
A commit references this bug:

Author: cpm
Date: Sat May 20 20:44:13 UTC 2017
New revision: 441335
URL: https://svnweb.freebsd.org/changeset/ports/441335

Log:
  security/py-certbot: Fix configargparse 0.12.0 regression

  This is caused by the recent release of configargparse version 0.12.0.
  The variable ACTION_TYPES_THAT_DONT_NEED_A_VALUE was changed from a set
  to a tuple in that release.

  Traceback (most recent call last):
    File "/usr/local/bin/certbot", line 11, in <module>
      load_entry_point('certbot==0.13.0', 'console_scripts', 'certbot')()
    File "/usr/local/lib/python2.7/site-packages/certbot/main.py", line 738, in main
      args = cli.prepare_and_parse_args(plugins, cli_args)
    File "/usr/local/lib/python2.7/site-packages/certbot/cli.py", line 1072, in prepare_and_parse_args
      helpful.add_deprecated_argument("--agree-dev-preview", 0)
    File "/usr/local/lib/python2.7/site-packages/certbot/cli.py", line 726, in add_deprecated_argument
      self.parser.add_argument, argument_name, num_args)
    File "/usr/local/lib/python2.7/site-packages/certbot/util.py", line 440, in add_deprecated_argument
      configargparse.ACTION_TYPES_THAT_DONT_NEED_A_VALUE.add(ShowWarning)
  AttributeError: 'tuple' object has no attribute 'add'

  PR:		219306
  Reported by:	GKK <netbackup.gs@gmail.com>
  Approved by:	koobs (maintainer)
  Obtained from:	https://github.com/certbot/certbot/commit/42d07d756df0cf96c9d20b44e772858391d48384

Changes:
  head/security/py-certbot/Makefile
  head/security/py-certbot/files/patch-certbot_tests_util__test.py
  head/security/py-certbot/files/patch-certbot_util.py
Comment 17 Carlos J. Puga Medina freebsd_committer freebsd_triage 2017-05-20 20:46:42 UTC
Committed!

Thanks