Murmur.ice error on #include

fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
Hullo,
I am new to the forum and to Ice, but I am trying to handle murmur and I was suggested Ice could do the job. So I installed it and tried activating it for murmur by means of the following python scripts stub:
#!/usr/bin/python
import Ice
Ice.loadSlice("/usr/local/murmur/ice/Murmur.ice")
#Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "Murmur.ice"])
import Murmur
# Init ice
comm = Ice.initialize()
Yet when I run it I get error:
/usr/local/murmur/ice/Murmur.ice:9: error: Can't open include file "Ice/SliceChecksumDict.ice"
#include <Ice/SliceChecksumDict.ice>
1 error in preprocessor.
Traceback (most recent call last):
File "ice.py", line 3, in <module>
Ice.loadSlice("/usr/local/murmur/ice/Murmur.ice")
RuntimeError: Slice preprocessing failed for `/usr/local/murmur/ice/Murmur.ice'

The location of SliceChecksumDict.ice in my system is /usr/share/Ice-3.5.1/slice/Ice/SliceChecksumDict.ice
What should I do on Murmur.ice to have it find the SliceChecksumDict.ice where it is?

Comments

  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff
    Hi,

    Try changing the script to disable the first call to Ice.loadSlice() and enable the second call to Ice.loadSlice(). It is adding a -I option to specify the installation directory of the Slice files:
    #!/usr/bin/python
    import Ice
    #Ice.loadSlice("/usr/local/murmur/ice/Murmur.ice")
    Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "Murmur.ice"])
    ...
    

    Regards,
    Mark
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    mes wrote: »
    Hi,

    Try changing the script to disable the first call to Ice.loadSlice() and enable the second call to Ice.loadSlice(). It is adding a -I option to specify the installation directory of the Slice files:
    #!/usr/bin/python
    import Ice
    #Ice.loadSlice("/usr/local/murmur/ice/Murmur.ice")
    Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "Murmur.ice"])
    ...
    

    Regards,
    Mark
    I had already tried that; it does not even find Murmur.ice...
    icecpp: error: cannot open `/var/www/html/iPhone/inarrivo/python/Murmur.ice' for reading
    Traceback (most recent call last):
    File "ice.py", line 4, in <module>
    Ice.loadSlice( '', )
    RuntimeError: Slice preprocessing failed for `'
  • mesmes CaliforniaMark SpruiellOrganization: ZeroC, Inc.Project: Ice DeveloperAdministrators, ZeroC Staff ZeroC Staff
    That should probably be:
    Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "/usr/local/murmur/ice/Murmur.ice"])
    

    Mark
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    mes wrote: »
    That should probably be:
    Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "/usr/local/murmur/ice/Murmur.ice"])
    

    Mark

    Thanks, in fact now it executed without errors. Now that I have you attention, could please tell me, now that I have my Ice instance well dressed to go to school... how do I create and delete channels on Murmur with its help?
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    Matt Conroy solution

    I was trying to follow the solution at:
    Matt · Conroy - Example ICE Script for Mumble Using Python
    Once overcome the first problems thanks to this thread, I got as far a down as:
    meta = Murmur.MetaPrx.checkedCast(proxy)
    
    where I get:
    Traceback (most recent call last):
    File "ice.py", line 13, in <module>
    meta = Murmur.MetaPrx.checkedCast(proxy)
    File "/usr/local/murmur/ice/Murmur.ice", line 4175, in checkedCast

    Ice.UnknownLocalException: exception ::Ice::UnknownLocalException
    {
    unknown = ../../include/Ice/BasicStream.h:175: Ice::UnsupportedEncodingException:
    protocol error: unsupported encoding version: 1.1
    (can only support encodings compatible with version 1.1)
    }
    while passing:
    proxy = comm.stringToProxy("Meta:tcp -p 6502")
    
    extraordinarily for free.
  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi Fabrizio,

    This encoding error message is unfortunately not correct - we'll fix it.

    If your Murmur server is using Ice 3.4 or earlier, the solution is to change your proxy to:
    proxy = comm.stringToProxy("Meta -e 1.0:tcp -p 6502")
    

    See https://doc.zeroc.com/display/Doc/New+in+Ice+3.5%3A+Encoding+Version+1.1 for a complete explanation.

    All the best,
    Bernard
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    bernard wrote: »
    Hi Fabrizio,

    This encoding error message is unfortunately not correct - we'll fix it.

    If your Murmur server is using Ice 3.4 or earlier, the solution is to change your proxy to:
    proxy = comm.stringToProxy("Meta -e 1.0:tcp -p 6502")
    

    See https://doc.zeroc.com/display/Doc/New+in+Ice+3.5%3A+Encoding+Version+1.1 for a complete explanation.

    All the best,
    Bernard
    Thank you very much, I was not even aware I had an old version of Ice. I installed it just the past week. Anyway now it runs and also prints the existing channels. I also tried to add one with:
    server.addChannel("humpty", 0)
    but I had an error; how do I add a channel instead? This is my complete updated script:
    #!/usr/bin/python
    import Ice
    #Ice.loadSlice("/usr/local/murmur/ice/Murmur.ice")
    Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "/usr/local/murmur/ice/Murmur.ice"])
    import Murmur
    
    # Init ice
    comm = Ice.initialize()
    # Let Ice know where to go to connect to mumble
    # Let Ice know where to go to connect to mumble
    proxy = comm.stringToProxy("Meta -e 1.0:tcp -p 6502")
    # Create a dynamic object that allows us to get a programmable interface for Mumble
    meta = Murmur.MetaPrx.checkedCast(proxy)
    # Get the server instance from the set of servers.
    server = meta.getServer(1)
    
    # Get a list of all channels
    channels = server.getChannels()
    #server.addChannel("humpty", 0)
    print channels
    
    For that matter, how would I update Ice to the latest version?

    Thank you very much for your insightful answers,
    Fabrizio
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    Found!

    I had to comment out:
    icesecretwrite=
    in /etc/murmur.ini: the new channel is inserted and shown - I excuse it twice:
    {0L:
    {
    id = 0
    name = Root
    parent = -1
    links =
    {
    }
    description =
    temporary = False
    position = 0
    }, 1L:
    {
    id = 1
    name = humpty
    parent = 0
    links =
    {
    }
    description =
    temporary = False
    position = 0
    }, 2L:
    {
    id = 2
    name = humpty
    parent = 0
    links =
    {
    }
    description =
    temporary = False
    position = 0
    }}
    Now the problem are the other functions, like checking if a channel already exists before inserting it. Is there some programming language manual of this stuff instead of progressing by trial and error?
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    Checking channel existence

    I set up this script to check if a channel existed before inserting it enough, but it gives weird results; this seems an issue with python rather than murmur, though; this is the updated script:
    #!/usr/bin/python
    import Ice
    import inspect
    #Ice.loadSlice("/usr/local/murmur/ice/Murmur.ice")
    Ice.loadSlice( '', ['-I' + Ice.getSliceDir(), "/usr/local/murmur/ice/Murmur.ice"])
    import Murmur
    
    # Init ice
    comm = Ice.initialize()
    # Let Ice know where to go to connect to mumble
    # Let Ice know where to go to connect to mumble
    #proxy = comm.stringToProxy("Meta:tcp -p 6502")
    proxy = comm.stringToProxy("Meta -e 1.0:tcp -p 6502")
    # Create a dynamic object that allows us to get a programmable interface for Mumble
    meta = Murmur.MetaPrx.checkedCast(proxy)
    # Get the server instance from the set of servers.
    server = meta.getServer(1)
    print dir(server)
    print(inspect.getargspec(server.removeChannel))
    newChannelName="humtpy"
    found=False
    channels = server.getChannels()
    for value in channels.itervalues():
       print "comparing "+value.name+" with "+newChannelName
       print len(value.name)
       print len(newChannelName)
       idChannel=value.id
       if value.name == newChannelName:
            print "found!"
            print idChannel
            found=True
            server.removeChannel(idChannel)
            break
       else:
            print "not found"
    # Get a list of all channels
    if found==False:
            print "added"+newChannelName
            server.addChannel(newChannelName, 0)
    channels = server.getChannels()
    #print channels
    
    And this is the output:
    ....
    ArgSpec(args=, varargs=None, keywords=None, defaults=(None,))
    comparing Root with humtpy
    4
    6
    not found
    comparing humpty with humtpy
    6
    6
    not found
    comparing humpty with humtpy
    6
    6
    not found
    comparing humtpy with humtpy
    6
    6
    found!
    3
    If I run this script serially each time just the last element is matched, removed and then addd again, although all the names of the channels are the same.
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    On the Mumble app

    And in fact on the Mumble app the "Humpty" channels vary between 2 and 3 each time I run the script.
  • bernardbernard Jupiter, FLBernard NormierOrganization: ZeroC, Inc.Project: IceAdministrators, ZeroC Staff ZeroC Staff
    Hi Fabrizio,

    It's good to see you're making progress!

    This forum is really about Ice; for Mumble/Murmur questions, I'd suggest a forum where more Mumble/Murmur developers hang around, such as forums.mumble.info • Index page (and I see you already found it).

    The "encoding error" issue you had earlier was because you are using Ice 3.5.x for your Python client while your Murmur server is using an older version of Ice (most likely Ice 3.4.x).

    Note that clients and servers built with Ice 3.4 and Ice 3.5 can talk to each other without any problem. You just need a few small adjustment like "-e 1.0" in some bootstrap proxies, as described in the article referenced earlier.

    Best regards,
    Bernard
  • fbartolomfbartolom Fabrizio BartolomucciOrganization: Mia FotoProject: I would like to use Ice to configure MurmurMember
    bernard wrote: »
    Hi Fabrizio,

    It's good to see you're making progress!

    This forum is really about Ice; for Mumble/Murmur questions, I'd suggest a forum where more Mumble/Murmur developers hang around, such as forums.mumble.info • Index page (and I see you already found it).

    The "encoding error" issue you had earlier was because you are using Ice 3.5.x for your Python client while your Murmur server is using an older version of Ice (most likely Ice 3.4.x).

    Note that clients and servers built with Ice 3.4 and Ice 3.5 can talk to each other without any problem. You just need a few small adjustment like "-e 1.0" in some bootstrap proxies, as described in the article referenced earlier.

    Best regards,
    Bernard
    And in fact my main question was about Ice, and I thank you very much for your answers. The last one would be how to update Ice to the latest version, and possibly keep it up-to-date, so to prevent future problems.
Sign In or Register to comment.