Loading ...
Sorry, an error occurred while loading the content.

Second level tie failed

Expand Messages
  • Csongor Fagyal
    Hi guys, I am having a re-occuring but random error. We have a few sites using Apache::ASP, and all of them randomly produce an Internal Server Error . After
    Message 1 of 3 , Dec 5, 2002
    • 0 Attachment
      Hi guys,

      I am having a re-occuring but random error. We have a few sites using
      Apache::ASP, and all of them randomly produce an "Internal Server
      Error". After refreshing, the error message disappears (then comes up
      again later).

      In the log, I can see the following:
      MLDBM error: Second level tie failed, "File exists" at
      /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 214


      I have tried using Data::Dumper instead of Storable, also tried DB_File,
      but the same thing occures again and again. Anybody seen something
      similar? What can I do?

      My config is: Apache 1.3.27, Apache::ASP 2.49, mod_perl 1.27, Redhat 8.0
      w/ 2.4.18 kernel, MLDBM 2.01, Perl 5.8.0.

      The error.log in more details is:

      MLDBM error: Second level tie failed, "File exists" at
      /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 214
      [Thu Dec 5 21:54:52 2002] [error] can't tie to MLDBM with args:
      /home/[....]/statedir/server/application,66,416; error: File exists at
      /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 214.
      MLDBM::Sync::SyncTie('MLDBM::Sync=HASH(0x90f1058)') called at
      /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 243
      MLDBM::Sync::Lock('MLDBM::Sync=HASH(0x90f1058)') called at
      /usr/lib/perl5/site_perl/5.8.0/Apache/ASP/State.pm line 357

      Apache::ASP::State::LOCK('Apache::ASP::Application=HASH(0x8d4d9c0)')
      called at /usr/lib/perl5/site_perl/5.8.0/Apache/ASP/Application.pm line 31

      Apache::ASP::Application::Lock('Apache::ASP::Application=HASH(0x8d4d9c0)')
      called at /usr/lib/perl5/site_perl/5.8.0/Apache/ASP/StateManager.pm line 135
      Apache::ASP::InitState('Apache::ASP=HASH(0x8fb5a44)') called at
      /usr/lib/perl5/site_perl/5.8.0/Apache/ASP.pm line 376

      Apache::ASP::new('Apache::ASP','Apache=SCALAR(0x8fb5378)','/home/[...]/index.asp')
      called at /usr/lib/perl5/site_perl/5.8.0/Apache/ASP.pm line 164
      Apache::ASP::handler('Apache=SCALAR(0x8fb5378)') called at
      /dev/null line 0
      eval {...} called at /dev/null line 0

      MLDBM error: Second level tie failed, "File exists" at
      /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 214


      Thank you,
      - Csongor


      ---------------------------------------------------------------------
      To unsubscribe, e-mail: asp-unsubscribe@...
      For additional commands, e-mail: asp-help@...
    • Josh Chamas
      ... The short of it is that I do not know what the problem is, but have some things for you to check & try below... The way in which file locking is handled
      Message 2 of 3 , Dec 7, 2002
      • 0 Attachment
        Csongor Fagyal wrote:
        > Hi guys,
        >
        > I am having a re-occuring but random error. We have a few sites using
        > Apache::ASP, and all of them randomly produce an "Internal Server
        > Error". After refreshing, the error message disappears (then comes up
        > again later).
        >
        > In the log, I can see the following:
        > MLDBM error: Second level tie failed, "File exists" at
        > /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 214
        >

        The short of it is that I do not know what the problem is, but
        have some things for you to check & try below...

        The way in which file locking is handled should prevent things
        of this nature happening. Also the way in which MLDBM is initialized
        with a call like:

        $self->{dbm} = &MLDBM::Sync::TIEHASH('MLDBM', $self->{file}, O_RDWR|O_CREAT, $self->{file_perms});

        should make things like "file exists" be a non-issue because
        O_RDWR|O_CREAT flags. The O_RDWR part in particular should make
        it so that even if the dbm has already been created, retying
        to it should not be a problem.

        Things I would suspect here are:

        ) if StateDir is pointed at a network file system, that
        file system does not support flock() semantics correctly
        Try pointing StateDir to a local file system.

        ) if multiple web servers have used the same StateDir, then
        they may have been run under different users, creating file
        permissions problems. Make sure to have web servers running
        with the same user name/permissions accessing StateDir

        ) if StateDB has been getting changed, then delete StateDir
        entirely, and keep your StateDB setting the same. This might
        be an error from having mixed dbm formats in the same directory.

        > I have tried using Data::Dumper instead of Storable, also tried DB_File,
        > but the same thing occures again and again. Anybody seen something
        > similar? What can I do?
        >

        If nothing else works, you might try StateDB setting of Tie::TextDir.
        This is an entirely different file storage system than dbms, and might
        not have the same problem for you. Note, again, you must delete
        StateDir before trying this setting.

        I would appreciate knowing what the resolution is if you find
        out the problem.

        Regards,

        Josh
        ________________________________________________________________
        Josh Chamas, Founder phone:925-552-0128
        Chamas Enterprises Inc. http://www.chamas.com
        NodeWorks Link Checking http://www.nodeworks.com


        ---------------------------------------------------------------------
        To unsubscribe, e-mail: asp-unsubscribe@...
        For additional commands, e-mail: asp-help@...
      • Csongor Fagyal
        ... Hi, I have managed to solve this problem, thanks to your help. ... It is a local statedir. ... Not this one, either. However, this problem arised after we
        Message 3 of 3 , Dec 10, 2002
        • 0 Attachment
          >
          >
          >> I am having a re-occuring but random error. We have a few sites using
          >> Apache::ASP, and all of them randomly produce an "Internal Server
          >> Error". After refreshing, the error message disappears (then comes up
          >> again later).
          >>
          >> In the log, I can see the following:
          >> MLDBM error: Second level tie failed, "File exists" at
          >> /usr/lib/perl5/site_perl/5.8.0/MLDBM/Sync.pm line 214
          >
          Hi,

          I have managed to solve this problem, thanks to your help.

          > The short of it is that I do not know what the problem is, but
          > have some things for you to check & try below...
          >
          > The way in which file locking is handled should prevent things
          > of this nature happening. Also the way in which MLDBM is initialized
          > with a call like:
          >
          > $self->{dbm} = &MLDBM::Sync::TIEHASH('MLDBM', $self->{file},
          > O_RDWR|O_CREAT, $self->{file_perms});
          >
          > should make things like "file exists" be a non-issue because
          > O_RDWR|O_CREAT flags. The O_RDWR part in particular should make
          > it so that even if the dbm has already been created, retying
          > to it should not be a problem.
          >
          > Things I would suspect here are:
          >
          > ) if StateDir is pointed at a network file system, that
          > file system does not support flock() semantics correctly
          > Try pointing StateDir to a local file system.

          It is a local statedir.

          > ) if multiple web servers have used the same StateDir, then
          > they may have been run under different users, creating file
          > permissions problems. Make sure to have web servers running
          > with the same user name/permissions accessing StateDir

          Not this one, either.
          However, this problem arised after we have reinstalled the server, and
          moved all user homes to the new hard disk. It was a cp -a, so it should
          not have been a problem, yet it looks like something got damaged during
          the copy. The strange thing is that the mentioned error only occured at
          some sites, randomly, and not very frequently (but repeatedly).

          > ) if StateDB has been getting changed, then delete StateDir
          > entirely, and keep your StateDB setting the same. This might
          > be an error from having mixed dbm formats in the same directory.

          Well, I have changed the StateDB after I have encountered this problem.

          >> I have tried using Data::Dumper instead of Storable, also tried
          >> DB_File, but the same thing occures again and again. Anybody seen
          >> something similar? What can I do?
          >>
          >
          > If nothing else works, you might try StateDB setting of Tie::TextDir.
          > This is an entirely different file storage system than dbms, and might
          > not have the same problem for you. Note, again, you must delete
          > StateDir before trying this setting.

          > I would appreciate knowing what the resolution is if you find
          > out the problem.

          Actually I have simply deleted statedir according to your suggestion,
          and now it looks like everything works. I don't think it was a
          permission error... but who knows, after a full reinstall :-). Maybe at
          some time Apache got restarted in a way it shouldn't have. (Or do file
          timestamps matter?)

          - Csongor


          ---------------------------------------------------------------------
          To unsubscribe, e-mail: asp-unsubscribe@...
          For additional commands, e-mail: asp-help@...
        Your message has been successfully submitted and would be delivered to recipients shortly.