Skip to content
This repository has been archived by the owner on Jun 27, 2024. It is now read-only.

Namespace error #19

Closed
grantbevis opened this issue Nov 19, 2017 · 8 comments
Closed

Namespace error #19

grantbevis opened this issue Nov 19, 2017 · 8 comments

Comments

@grantbevis
Copy link
Contributor

Hi,

I'm attempting to create a docker image for this script using a small alpine linux base. I've had it running fine on Friday night after solving this namespace issue but for the life of me I cannot remember what I did. The error I'm getting is

/ # redactedbetter 
Traceback (most recent call last):
  File "/usr/bin/redactedbetter", line 4, in <module>
    __import__('pkg_resources').run_script('redactedbetter==1.3', 'redactedbetter')
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1501, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python2.7/site-packages/redactedbetter-1.3-py2.7.egg/EGG-INFO/scripts/redactedbetter", line 231, in <module>
    
  File "/usr/lib/python2.7/site-packages/redactedbetter-1.3-py2.7.egg/EGG-INFO/scripts/redactedbetter", line 90, in main
    
  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'redacted'

I've done pip install ns and pip install namespace. I'm running the setup via python setup.py install

I'm sure it's something simple but I can't work it out myself!

Thanks,
b3vis

@grantbevis
Copy link
Contributor Author

I managed to solve this part:

  File "/usr/lib/python2.7/ConfigParser.py", line 607, in get
    raise NoSectionError(section)
ConfigParser.NoSectionError: No section: 'redacted'

by renaming the top section in my config file ;)

@taylorthurlow
Copy link
Contributor

Sorry about that! I made a bunch of sweeping name changes last night, and didn't think about the config section header name changing. Glad you got it sorted.

@grantbevis
Copy link
Contributor Author

I still have the top issue referring to namespace unfortunately, now I get logged into the site and it searches for the first item to process and the it exits with pretty much the same error as above.

@taylorthurlow
Copy link
Contributor

Can you post the stack trace as it is now?

@grantbevis
Copy link
Contributor Author

grantbevis commented Nov 20, 2017

Apologies, it would have been useful if I had commented with that before!

~ # redactedbetter 
Logging in to PTH...
Searching for transcode candidates...

Release found: <snip>
Release URL: <snip>
Formats needed: 
Traceback (most recent call last):
  File "/usr/bin/redactedbetter", line 4, in <module>
    __import__('pkg_resources').run_script('redactedbetter==1.3', 'redactedbetter')
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1501, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/lib/python2.7/site-packages/redactedbetter-1.3-py2.7.egg/EGG-INFO/scripts/redactedbetter", line 231, in <module>
    
  File "/usr/lib/python2.7/site-packages/redactedbetter-1.3-py2.7.egg/EGG-INFO/scripts/redactedbetter", line 227, in main
    
AttributeError: 'str' object has no attribute 'add'
~ # 

Edit: Also just to rule it out I created a Debian container with all the dependancies and I get the same error;

Traceback (most recent call last):
  File "/usr/local/bin/redactedbetter", line 4, in <module>
    __import__('pkg_resources').run_script('redactedbetter==1.3', 'redactedbetter')
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 739, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 1501, in run_script
    exec(script_code, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/redactedbetter-1.3-py2.7.egg/EGG-INFO/scripts/redactedbetter", line 231, in <module>
    
  File "/usr/local/lib/python2.7/dist-packages/redactedbetter-1.3-py2.7.egg/EGG-INFO/scripts/redactedbetter", line 227, in main
    
AttributeError: 'str' object has no attribute 'add'

I wanted to ensure that it wasn't something strange with using Alpine linux which it appears not to be the case.

Edit 2: back using alpine if I pull the previous commit before the name changes it's working so must be something with the name change mate, I'll continue testing and if I fix it I'll submit a PR.

@grantbevis
Copy link
Contributor Author

Solved it, I deleted my cache file and it's on it's merry way! cheers guys!

@taylorthurlow
Copy link
Contributor

Phew, I'm glad I didn't break anything serious. Interesting, though - does your docker image have a default cache file it uses? I'd assume that it's generated the first time you run the script.

@grantbevis
Copy link
Contributor Author

I mount the cache file from the host to inside the container, same for config :) once I've finished my testing and I'm happy I'll up the code to my GitHub and I'll put a PR in here for the readme of how to use the image with docker.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants