Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Synthesize Action: TypeError On Docker #13

Closed
treid003 opened this issue Jun 24, 2020 · 3 comments
Closed

Synthesize Action: TypeError On Docker #13

treid003 opened this issue Jun 24, 2020 · 3 comments
Assignees
Labels
bug

Comments

@treid003
Copy link

@treid003 treid003 commented Jun 24, 2020

When using the synthesize action on Docker a type error occurs ("TypeError: 'Namespace' object is not iterable").

The command I used is listed below:
hc synthesize warcs -i archiveit -a 7760 -o South_Louisiana_Flood

sythesize_action_error_docker_windows

@shawnmjones
Copy link
Member

@shawnmjones shawnmjones commented Jun 24, 2020

I have reproduced this...

# docker-compose run hypercane hc synthesize warcs -i archiveit -a 7760 -o South_Louisiana_Flood                                                                                           0
Starting hypercane_mongodb_1 ... done
/usr/local/lib/python3.7/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Traceback (most recent call last):
  File "/usr/local/bin/hc", line 105, in <module>
    sys.argv[3:])
  File "/usr/local/lib/python3.7/site-packages/hypercane/actions/synthesize.py", line 329, in synthesize_warcs
    args = process_input_args(args, parser)
  File "/usr/local/lib/python3.7/site-packages/hypercane/actions/synthesize.py", line 22, in process_input_args
    args = parser.parse_args(args)
  File "/usr/local/lib/python3.7/argparse.py", line 1749, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/local/lib/python3.7/argparse.py", line 1761, in parse_known_args
    args = list(args)
TypeError: 'Namespace' object is not iterable
@shawnmjones shawnmjones self-assigned this Jun 24, 2020
@shawnmjones shawnmjones added the bug label Jun 24, 2020
@shawnmjones
Copy link
Member

@shawnmjones shawnmjones commented Jun 24, 2020

This issue does not happen in a clean Python virtualenv on macOS 10.15.5.

# hc synthesize warcs -i archiveit -a 7760 -o ~/tmp/South_Louisiana_Flood                                                                                                                  
2020-06-23 19:34:52,667 [INFO] hypercane.actions.synthesize: Starting generation of files from input
2020-06-23 19:34:52,668 [INFO] hypercane.identify: processing input for type archiveit
2020-06-23 19:34:52,668 [INFO] hypercane.identify: discovering mementos for input type archiveit
2020-06-23 19:34:57,815 [INFO] hypercane.identify: discovered 359 URIs
2020-06-23 19:34:57,815 [INFO] hypercane.actions.synthesize: discovered 359 URI-Ms from the input
2020-06-23 19:34:57,816 [INFO] hypercane.actions.synthesize: Output directory /Users/smj/tmp/South_Louisiana_Flood does not exist, creating...
2020-06-23 19:40:48,848 [INFO] hypercane.actions.synthesize: Done generating directory of files, output is at /Users/smj/tmp/South_Louisiana_Flood

It is definitely a problem with the Docker configuration.

@shawnmjones
Copy link
Member

@shawnmjones shawnmjones commented Jun 24, 2020

Like the stacktrace states, the problem is on line 22 of hypercane/actions/synthesize.py:

args = parser.parse_args(args)
args = test_input_args(args)
args = parser.parse_args(args)

There is a duplicate call to parser.parse_args. I do not know why I inserted it. I'm going to run some tests inside and outside Docker. It definitely fails in Docker, but works fine in macOS. ¯_(ツ)_/¯

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.