GithubHelp home page GithubHelp logo

Comments (8)

ldx avatar ldx commented on June 9, 2024

Can you tell me the version/git hash you use?

from python-iptables.

jawr avatar jawr commented on June 9, 2024

Hi there, thanks for the quick response! I'm on the latest (b88763c). Also, I'm using Debian 7.0.0 - 3.2.0-3-amd64 with iptables: v1.4.14

It seems that the handle might be going stale or something, as when I repeatedly refresh (call on the chain) it eventually stops updating and then throws the error.

The functions are here: https://github.com/jawr/kontrolvm-node/blob/master/tasks/iptables.py#L28

from python-iptables.

ldx avatar ldx commented on June 9, 2024

Can you isolate the code that triggers this problem? I tried this simplistic script:

#!/usr/bin/python

import iptc

while True:
    chain_name = 'FORWARD'
    chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), chain_name)
    print chain.name

but here it works without issues.

from python-iptables.

 avatar commented on June 9, 2024

I think the problem found in the kernel's modules not enabled, as described in this link:
http://thelinuxtricks.blogspot.de/2013/05/python-iptables-libiptc-version-error.html

The modules are:

  • ip_conntrack
  • ipt_state

unfortunately in the new kernel the "ip_conntrack" is deprecated and "sudo modprobe ip_conntrack" don't work.

What do you think?

from python-iptables.

ldx avatar ldx commented on June 9, 2024

Hi @vinc3nt - the lack/depreciation of a kernel module should not cause any problems as long as the userspace and kernel parts of iptables are in sync. Let me know if you see a specific problem.

from python-iptables.

 avatar commented on June 9, 2024

Hi @ldx, here is what happens if I try to launch your script:

-> % python2.7                                                    
Python 2.7.4 (default, Apr 19 2013, 18:28:01) 
[GCC 4.7.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import iptc
>>> while True:
...     chain_name = 'FORWARD'
...     chain = iptc.Chain(iptc.Table(iptc.Table.FILTER), chain_name)
...     print chain.name
... 
Traceback (most recent call last):
  File "<stdin>", line 3, in <module>
  File "/usr/local/lib/python2.7/dist-packages/iptc/ip4tc.py", line 1306, in __init__
    self.refresh()
  File "/usr/local/lib/python2.7/dist-packages/iptc/ip4tc.py", line 1342, in refresh
    self.strerror()))
iptc.ip4tc.IPTCError: can't initialize filter: libiptc version error
>>> 

I have installed with pip the last version of python-iptables

from python-iptables.

ldx avatar ldx commented on June 9, 2024

The error message suggests that you use an old version - can you remove your current install, clone from github, and use the current git HEAD? For me it's been stable for quite some time both on Ubuntu & Debian, and the test script works as expected as well.

from python-iptables.

ldx avatar ldx commented on June 9, 2024

No response for months - closing this ticket, feel free to reopen it if the problem still exists.

from python-iptables.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.