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

AttributeError: 'NoneType' object has no attribute 'split' #79

Closed
saboor97 opened this issue Mar 26, 2019 · 7 comments
Closed

AttributeError: 'NoneType' object has no attribute 'split' #79

saboor97 opened this issue Mar 26, 2019 · 7 comments

Comments

@saboor97
Copy link

Traceback (most recent call last):
File "/usr/local/bin/staticDHCPd", line 294, in
_initialiseDHCP()
File "/usr/local/bin/staticDHCPd", line 224, in _initialiseDHCP
dhcp = staticdhcpdlib.dhcp.DHCPService(database)
File "/usr/local/lib/python2.7/dist-packages/staticdhcpdlib/dhcp.py", line 865, in init
database
File "/usr/local/lib/python2.7/dist-packages/staticdhcpdlib/dhcp.py", line 410, in init
response_interface_qtags=response_interface_qtags,
File "/usr/local/lib/python2.7/dist-packages/libpydhcpserver/dhcp.py", line 114, in init
response_interface = getifaddrslib.get_network_interface(server_address)
File "/usr/local/lib/python2.7/dist-packages/libpydhcpserver/getifaddrslib.py", line 139, in get_network_interface
return interface.split(':', 1)[0]
AttributeError: 'NoneType' object has no attribute 'split'

2019-03-25 14:34:13,271 : WARNING : System shutdown beginning...

@saboor97
Copy link
Author

Can anyone please help me with this? I'm new at this. :)

@flan
Copy link
Owner

flan commented Mar 29, 2019

Hey, sorry for the delay in getting back to you. I typed a response and got pulled away before hitting send. :(
(Thanks for the poke on my blog -- I would have forgotten otherwise)

I'm afraid I'll need a little more information to figure out what's going on here.

From the message and your pull-request, it looks like you've got an awkwardly formatted interface-name somewhere, but without seeing your config, it'll be hard to guess at what's happening.

Can you respond with whatever information you can share about your interface configuration in conf.py and/or the output of ifconfig -a | grep Link and ls -1 /sys/class/net/? (You can obscure the MAC addresses if you consider those sensitive information)

It's entirely possible that I simply misunderstood something about how aliased interfaces show up in libc and I can verify that easily enough if what you have matches what I expect.

@saboor97
Copy link
Author

saboor97 commented Mar 30, 2019 via email

@flan
Copy link
Owner

flan commented Mar 30, 2019

Sure, but I'll need some information to work with, like where in the process you've run into problems.

And I would like to resolve the issue that you first reported: what was the solution to your problem? Do I need to make any changes to the code?

@saboor97
Copy link
Author

i removed line 139 in File "/libpydhcpserver/getifaddrslib.py", line 139, in get_network_interface
return interface.split(':', 1)[0]
This solved issue for me :)

@saboor97
Copy link
Author

i ran into this error when i started server by executing "sudo python staticDHCPd"

@saboor97
Copy link
Author

#Copy this file to one of the following locations, then rename it to conf.py:
#/etc/staticDHCPd/, ./conf/

#For a full overview of what these parameters mean, and to further customise
#your system, please consult the configuration and scripting guides in the
#standard documentation

Whether to daemonise on startup (you don't want this during initial setup)

DAEMON = False

#WARNING: The default UID and GID are those of root. THIS IS NOT GOOD!
#If testing, set them to your id, which you can find using id in a terminal.
#If going into production, if no standard exists in your environment, use the
#values of "nobody": id nobody
#The UID this server will use after initial setup
UID = 0
#The GID this server will use after initial setup
GID = 0

#The IP of the interface to use for DHCP traffic
DHCP_SERVER_IP = '192.168.1.1'
#The database-engine to use
#For details, see the configuration guide in the documentation.
DATABASE_ENGINE = 'SQLite'
SQLITE_FILE = '/home/saboor/staticdhcpd/staticDHCPd/dhcp.sqlite3'

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

No branches or pull requests

2 participants