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

cannot open log file

Expand Messages
  • nicolasfranck.jl12
    Hi there, I m using webalizer V2.21-02 (Linux 2.6.32-131.17.1.el6.x86_64 x86_64) English on a redhat-server, and trying to configure out why webalizer is
    Message 1 of 4 , Jan 15, 2012
    View Source
    • 0 Attachment
      Hi there,

      I'm using webalizer V2.21-02 (Linux 2.6.32-131.17.1.el6.x86_64 x86_64) English on a redhat-server, and trying to configure out why webalizer
      is giving me this error message:

      'cannot access log file /var/log/nginx/access.log'

      I checked the permissions on the file, and they are all fine. Webalizer was installed using a yum-repository.

      here a part of the configuration file (/etc/webalizer.conf):
      [code]
      LogFile /var/log/nginx/access.log
      OutputDir /var/www/usage
      [/code]
      the permission on /var/www/usage are also fine ;-)
      and this is wat 'strace webalizer' gives:
      [code]
      execve("/usr/bin/webalizer", ["webalizer"], [/* 28 vars */]) = 0
      brk(0) = 0x238e000
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4de000
      access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
      open("/etc/ld.so.cache", O_RDONLY) = 3
      fstat(3, {st_mode=S_IFREG|0644, st_size=44927, ...}) = 0
      mmap(NULL, 44927, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f113c4d3000
      close(3) = 0
      open("/lib64/libbz2.so.1", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\26\0\r7\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=69976, ...}) = 0
      mmap(0x370d000000, 2162768, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x370d000000
      mprotect(0x370d010000, 2093056, PROT_NONE) = 0
      mmap(0x370d20f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xf000) = 0x370d20f000
      close(3) = 0
      open("/lib64/libdb-4.7.so", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240\206\302\n7\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=1526984, ...}) = 0
      mmap(0x370ac00000, 3620704, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x370ac00000
      mprotect(0x370ad6f000, 2093056, PROT_NONE) = 0
      mmap(0x370af6e000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x16e000) = 0x370af6e000
      close(3) = 0
      open("/usr/lib64/libgd.so.2", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000\206\240P=\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=275328, ...}) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4d2000
      mmap(0x3d50a00000, 2384392, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3d50a00000
      mprotect(0x3d50a22000, 2097152, PROT_NONE) = 0
      mmap(0x3d50c22000, 135168, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x22000) = 0x3d50c22000
      mmap(0x3d50c43000, 12808, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x3d50c43000
      close(3) = 0
      open("/usr/lib64/libpng12.so.0", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0000H`\376;\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=159728, ...}) = 0
      mmap(0x3bfe600000, 2252320, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3bfe600000
      mprotect(0x3bfe626000, 2093056, PROT_NONE) = 0
      mmap(0x3bfe825000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x25000) = 0x3bfe825000
      close(3) = 0
      open("/lib64/libz.so.1", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\360\36@\0077\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=88240, ...}) = 0
      mmap(0x3707400000, 2181040, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3707400000
      mprotect(0x3707415000, 2093056, PROT_NONE) = 0
      mmap(0x3707614000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x3707614000
      close(3) = 0
      open("/lib64/libm.so.6", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\240>\300\0067\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=598816, ...}) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4d1000
      mmap(0x3706c00000, 2633944, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3706c00000
      mprotect(0x3706c83000, 2093056, PROT_NONE) = 0
      mmap(0x3706e82000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x82000) = 0x3706e82000
      close(3) = 0
      open("/lib64/libc.so.6", O_RDONLY) = 3
      read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0\320\r\300\t7\0\0\0"..., 832) = 832
      fstat(3, {st_mode=S_IFREG|0755, st_size=13168, ...}) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4cd000
      mmap(0x3709c00000, 2106112, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x3709c00000
      mprotect(0x3709c02000, 2097152, PROT_NONE) = 0
      mmap(0x3709e02000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x2000) = 0x3709e02000
      close(3) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4cc000
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4cb000
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4ca000
      arch_prctl(ARCH_SET_FS, 0x7f113c4cb700) = 0
      mprotect(0x3706e82000, 4096, PROT_READ) = 0
      mprotect(0x3706385000, 16384, PROT_READ) = 0
      mprotect(0x3706616000, 4096, PROT_READ) = 0
      mprotect(0x3705a1f000, 4096, PROT_READ) = 0
      mprotect(0x3705e02000, 4096, PROT_READ) = 0
      munmap(0x7f113c4d3000, 44927) = 0
      set_tid_address(0x7f113c4cb9d0) = 4866
      set_robust_list(0x7f113c4cb9e0, 0x18) = 0
      futex(0x7fffb7f5a03c, FUTEX_WAKE_PRIVATE, 1) = 0
      futex(0x7fffb7f5a03c, FUTEX_WAIT_BITSET_PRIVATE|FUTEX_CLOCK_REALTIME, 1, NULL, 7f113c4cb700) = -1 EAGAIN (Resource temporarily unavailable)
      rt_sigaction(SIGRTMIN, {0x3706405a90, [], SA_RESTORER|SA_SIGINFO, 0x370640f490}, NULL, 8) = 0
      rt_sigaction(SIGRT_1, {0x3706405b20, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x370640f490}, NULL, 8) = 0
      rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0
      getrlimit(RLIMIT_STACK, {rlim_cur=10240*1024, rlim_max=RLIM_INFINITY}) = 0
      brk(0) = 0x238e000
      brk(0x23af000) = 0x23af000
      open("/usr/lib/locale/locale-archive", O_RDONLY) = 3
      fstat(3, {st_mode=S_IFREG|0644, st_size=99158752, ...}) = 0
      mmap(NULL, 99158752, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f1136639000
      close(3) = 0
      stat("webalizer.conf", {st_mode=S_IFREG|0644, st_size=23946, ...}) = 0
      getuid() = 505
      access("/etc/webalizer.conf", F_OK) = 0
      open("/etc/webalizer.conf", O_RDONLY) = 3
      fstat(3, {st_mode=S_IFREG|0644, st_size=23946, ...}) = 0
      mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f113c4dd000
      read(3, "#\n# Sample Webalizer configurati"..., 4096) = 4096
      read(3, " for the report. This is used i"..., 4096) = 4096
      read(3, "L code to insert at the bottom o"..., 4096) = 4096
      read(3, " hideous and ugly, say 'no' here"..., 4096) = 4096
      read(3, "l should be seperated from\n# the"..., 4096) = 4096
      read(3, "# precidence over the Ignore* ke"..., 4096) = 3466
      read(3, "", 4096) = 0
      close(3) = 0
      munmap(0x7f113c4dd000, 4096) = 0
      lstat("/var/log/nginx/access.log", {st_mode=S_IFREG|0644, st_size=80760251, ...}) = 0
      open("/var/log/nginx/access.log", O_RDONLY) = -1 EACCES (Permission denied)
      write(2, "Error: Can't open log file /var/"..., 53) = 53
      exit_group(1)
      [/code]

      thanks in advance
    • waldo kitty
      ... at a guess, i d say that you re trying to read a live log file... one that the server has open and locked for all access... it would be nice if it opened
      Message 2 of 4 , Jan 16, 2012
      View Source
      • 0 Attachment
        On 1/16/2012 02:36, nicolasfranck.jl12 wrote:
        > Hi there,
        >
        > I'm using webalizer V2.21-02 (Linux 2.6.32-131.17.1.el6.x86_64 x86_64) English on a redhat-server, and trying to configure out why webalizer
        > is giving me this error message:
        >
        > 'cannot access log file /var/log/nginx/access.log'
        >
        > I checked the permissions on the file, and they are all fine. Webalizer was installed using a yum-repository.
        >
        > here a part of the configuration file (/etc/webalizer.conf):
        > [code]
        > LogFile /var/log/nginx/access.log
        > OutputDir /var/www/usage
        > [/code]
        > the permission on /var/www/usage are also fine ;-)
        > and this is wat 'strace webalizer' gives:

        at a guess, i'd say that you're trying to read a live log file... one that the
        server has open and locked for all access... it would be nice if it opened the
        log file for write and didn't deny read... at least this is what i recall from
        years past on my system when i fought a similar problem... i could only process
        historical (ie: non-live) logs at that time... i also wanted an easy logrotate
        capability... my OS doesn't/didn't have all the capabilites of other OS' so i
        use a logfile tool for my server to write my logs with... the tool closes the
        file after each write...

        if you don't have such a tool and you confirm this is the problem, then you'll
        only be able to process historical log (or maybe a copy if you can do that)...
      • nicolasfranck.jl12
        Thanks for your reply I already tried that. I copied the logfile to my home folder, renamed it, and changed the configuration file to point to the custom
        Message 3 of 4 , Jan 17, 2012
        View Source
        • 0 Attachment
          Thanks for your reply

          I already tried that. I copied the logfile to my home folder,
          renamed it, and changed the configuration file to point
          to the custom logfile in my folder. But still the
          same error:
          'cannot access log file /home/njfrank/test.log'

          on my ubuntu webalizer of the same version works fine.


          --- In webalizer@yahoogroups.com, waldo kitty <wkitty42@...> wrote:
          >
          > On 1/16/2012 02:36, nicolasfranck.jl12 wrote:
          > > Hi there,
          > >
          > > I'm using webalizer V2.21-02 (Linux 2.6.32-131.17.1.el6.x86_64 x86_64) English on a redhat-server, and trying to configure out why webalizer
          > > is giving me this error message:
          > >
          > > 'cannot access log file /var/log/nginx/access.log'
          > >
          > > I checked the permissions on the file, and they are all fine. Webalizer was installed using a yum-repository.
          > >
          > > here a part of the configuration file (/etc/webalizer.conf):
          > > [code]
          > > LogFile /var/log/nginx/access.log
          > > OutputDir /var/www/usage
          > > [/code]
          > > the permission on /var/www/usage are also fine ;-)
          > > and this is wat 'strace webalizer' gives:
          >
          > at a guess, i'd say that you're trying to read a live log file... one that the
          > server has open and locked for all access... it would be nice if it opened the
          > log file for write and didn't deny read... at least this is what i recall from
          > years past on my system when i fought a similar problem... i could only process
          > historical (ie: non-live) logs at that time... i also wanted an easy logrotate
          > capability... my OS doesn't/didn't have all the capabilites of other OS' so i
          > use a logfile tool for my server to write my logs with... the tool closes the
          > file after each write...
          >
          > if you don't have such a tool and you confirm this is the problem, then you'll
          > only be able to process historical log (or maybe a copy if you can do that)...
          >
        • waldo kitty
          ... the only other thing i can think of, at this time, is possibly permissions... what are the permissions on the file? what user and group is webalizer
          Message 4 of 4 , Jan 18, 2012
          View Source
          • 0 Attachment
            On 1/18/2012 02:35, nicolasfranck.jl12 wrote:
            > Thanks for your reply
            >
            > I already tried that. I copied the logfile to my home folder,
            > renamed it, and changed the configuration file to point
            > to the custom logfile in my folder. But still the
            > same error:
            > 'cannot access log file /home/njfrank/test.log'
            >
            > on my ubuntu webalizer of the same version works fine.

            the only other thing i can think of, at this time, is possibly permissions...
            what are the permissions on the file? what user and group is webalizer running
            as? is the webalizer user a member of a group that has access to that file?

            > --- In webalizer@yahoogroups.com, waldo kitty<wkitty42@...> wrote:
            >>
            >> On 1/16/2012 02:36, nicolasfranck.jl12 wrote:
            >>> Hi there,
            >>>
            >>> I'm using webalizer V2.21-02 (Linux 2.6.32-131.17.1.el6.x86_64 x86_64) English on a redhat-server, and trying to configure out why webalizer
            >>> is giving me this error message:
            >>>
            >>> 'cannot access log file /var/log/nginx/access.log'
            >>>
            >>> I checked the permissions on the file, and they are all fine. Webalizer was installed using a yum-repository.
            >>>
            >>> here a part of the configuration file (/etc/webalizer.conf):
            >>> [code]
            >>> LogFile /var/log/nginx/access.log
            >>> OutputDir /var/www/usage
            >>> [/code]
            >>> the permission on /var/www/usage are also fine ;-)
            >>> and this is wat 'strace webalizer' gives:
            >>
            >> at a guess, i'd say that you're trying to read a live log file... one that the
            >> server has open and locked for all access... it would be nice if it opened the
            >> log file for write and didn't deny read... at least this is what i recall from
            >> years past on my system when i fought a similar problem... i could only process
            >> historical (ie: non-live) logs at that time... i also wanted an easy logrotate
            >> capability... my OS doesn't/didn't have all the capabilites of other OS' so i
            >> use a logfile tool for my server to write my logs with... the tool closes the
            >> file after each write...
            >>
            >> if you don't have such a tool and you confirm this is the problem, then you'll
            >> only be able to process historical log (or maybe a copy if you can do that)...
          Your message has been successfully submitted and would be delivered to recipients shortly.