Error unable to open log file

I have a problem with running eclipse image under docker. Particular with the access to the log folder. Compose file: version: '2.1' services: mqtt: image: eclipse-mosquitto:latest containe...

I have exact same issue and i have literally tried EVERYTHING in this issue and more, have spent two days on this before i am writing this.

I have a NFS mount on the machine and i use docker-compose and use latest mosquitto. I have tried setting the owner to 1883:1883, i have tried to set permissions using chmod -R 777, i have tried to set the user: 1883:1883 and i also tried to set the

environment:
  - PGID=1883
  - PUID=1883

No matter what i do i get :

Error: Unable to open pwfile "/mosquitto/config/mosquitto.passwd".
Error opening password file "/mosquitto/config/mosquitto.passwd".
Error: Unable to open log file /mosquitto/log/mosquitto.log for writing.

Here is my docker-compose :

services:
  mosquitto:
      container_name: mosquitto
      restart: always
      image: eclipse-mosquitto:latest
      volumes:
        - "{{ app_data_dir }}/mosquitto/config:/mosquitto/config"
        - "{{ app_data_dir }}/mosquitto/data:/mosquitto/data"
        - "{{ app_data_dir }}/mosquitto/log:/mosquitto/log"
        - /etc/localtime:/etc/localtime:ro
      ports:
        - "1883:1883"
        - "9001:9001"
      networks:
        internal_net:
          ipv4_address: {{mosquitto_ip}}
      labels:
        - "traefik.enable=false"
      environment:
        - PUID=1883
        - PGID=1883
networks:
  proxy:
    external: true
  internal_net:
    external: true

Here is the output of the permissions and owner :

ansible@myvm-0-dev:~$ sudo ls -lR /var/docker_data/mosquitto
/var/docker_data/mosquitto:
total 0
drwxrwxrwx 1 1883 1883 102 Feb  3 16:57 config
drwxrwxrwx 1 1883 1883  24 Mar 11 15:32 data
drwxrwxrwx 1 1883 1883   0 Mar 13 23:20 log

/var/docker_data/mosquitto/config:
total 12
-rwxrwxrwx 1 1883 1883 186 Mar 13 22:50  mosquitto.conf
-rwxrwxrwx 1 1883 1883 351 Mar 11 17:00  mosquitto.passwd
-rwxrwxrwx 1 1883 1883 235 Mar 30  2020 'mosquitto.passwd copy'

/var/docker_data/mosquitto/data:
total 4
-rwxrwxrwx 1 1883 1883 143 Mar 11 15:32 mosquitto.db

/var/docker_data/mosquitto/log:
total 0

Here is my NFS mount in fstab mount :

10.10.0.15:/volume1/docker_test /var/docker_data nfs rw,sync 0 0

If anybody has some idea more that has been described in this issue please do share since i don’t know what else i can try ? I can see the dockerfile sets the owner of the file to 1883 so even in the cases where i tries to run as another user the container sets the owner of the files to 1883.

I received this error message when I was trying to perform a data pump export of SH schema in parallel in a RAC database. I proceeded as follows:

Current scenario:
Name of the cluster: cluster01
Number of nodes : 3 (host01, host02, host03)
RAC Database version: 11.2.0.3
Name of RAC database : orcl
Number of instances : 3

  • Created a directory object  pointing to shared storage which is accessible by all the three instances of the database
SQL>drop directory dp_shared_dir;
SQL>create directory DP_SHARED_DIR as '+DATA/orcl/';
SQL>grant read, write on directory dp_shared_dir to public;
  • Issued the command to export SH schema in parallel across all active Oracle RAC instances with parallelism = 6 which resulted in error ORA-39070
[oracle@host01 root]$ expdp system/oracle@orcl schemas=sh directory=dp_shared_dir parallel=6 cluster=y dumpfile='expsh%U.dmp' reuse_dumpfiles=y

Export: Release 11.2.0.3.0 - Production on Tue Dec 8 14:45:39 2015
Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.
Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
 With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
 Data Mining and Real Application Testing options
 ORA-39002: invalid operation
 ORA-39070: Unable to open the log file.
 ORA-29283: invalid file operation
 ORA-06512: at "SYS.UTL_FILE", line 536
 ORA-29283: invalid file operation

Cause:
The error message indicates that Log file cannot be opened. Since directory parameter points to a shared location on an ASM disk group and log file is not supported on it, I received the above error.

Solution:
I modified my command and explicitly specified log file to be created on  local file system pointed to by the directory object DATA_PUMP_DIR. Subsequently, export was performed successfully.

[oracle@host01 root]$ expdp system/oracle@orcl schemas=sh directory=dp_shared_dir parallel=6 cluster=y logfile=data_pump_dir:expsh.log dumpfile='expsh%U.dmp' reuse_dumpfiles=y

Export: Release 11.2.0.3.0 - Production on Tue Dec 8 15:14:11 2015

Copyright (c) 1982, 2011, Oracle and/or its affiliates. All rights reserved.

Connected to: Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - Production
With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP,
Data Mining and Real Application Testing options
Starting "SYSTEM"."SYS_EXPORT_SCHEMA_10": system/********@orcl schemas=sh directory=dp_shared_dir parallel=6 cluster=y logfile=data_pump_dir:expsh.log dumpfile=expsh%U.dmp reuse_dumpfiles=y
Estimate in progress using BLOCKS method...
Processing object type SCHEMA_EXPORT/TABLE/TABLE_DATA
Total estimation using BLOCKS method: 273.8 MB
Processing object type SCHEMA_EXPORT/USER
Processing object type SCHEMA_EXPORT/SYSTEM_GRANT
Processing object type SCHEMA_EXPORT/ROLE_GRANT
.....
.....
Processing object type SCHEMA_EXPORT/TABLE/STATISTICS/TABLE_STATISTICS
Processing object type SCHEMA_EXPORT/TABLE/INDEX/DOMAIN_INDEX/INDEX
Processing object type SCHEMA_EXPORT/MATERIALIZED_VIEW
Processing object type SCHEMA_EXPORT/DIMENSION
Master table "SYSTEM"."SYS_EXPORT_SCHEMA_10" successfully loaded/unloaded
******************************************************************************
Dump file set for SYSTEM.SYS_EXPORT_SCHEMA_10 is:
+DATA/orcl/expsh01.dmp
+DATA/orcl/expsh02.dmp
+DATA/orcl/expsh03.dmp
+DATA/orcl/expsh04.dmp
+DATA/orcl/expsh05.dmp
+DATA/orcl/expsh06.dmp
Job "SYSTEM"."SYS_EXPORT_SCHEMA_10" successfully completed at 15:20:49

I hope it helps!!!

—————————————————————————————————————-

Related links:  

I installed httpd on a CentOS 7 server, but systemctl start httpd.service is failing.

What specific sequence of commands need to be typed in order to get httpd to start correctly on CentOS 7?


Error Message


The precise error message extracted from the full results at bottom is as follows:

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain.   
Set the 'ServerName' directive globally to suppress this message  

Also, per @DopeGhoti’s suggestion, the contents of the logs are:

[root@localhost ~]# vi /var/log/httpd/error_log
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.

How httpd was installed:


1.) Install Apache:

sudo yum -y install httpd

2.) Enable Apache as a CentOS service so that it will automatically restart on reboot:

sudo systemctl enable httpd.service

3.) Configure Firewalld

sudo firewall-cmd --zone=public --add-service=http
sudo firewall-cmd --list-all
sudo firewall-cmd --zone=public --permanent --add-service=http  

4.) Give the server a name:

vi /etc/httpd/conf/httpd.conf
//Uncomment the ServerName line and give it the IP of the machine:  
ServerName 192.168.1.5:80

The error message:


After installing httpd using the above commands, httpd is failing to start as follows:

[root@localhost ~]# systemctl start httpd.service
Job for httpd.service failed because the control process exited with error code. See "systemctl status httpd.service" and "journalctl -xe" for details.


[root@localhost ~]# systemctl status httpd.service -l
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Tue 2017-06-06 11:31:32 PDT; 15min ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 32268 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
  Process: 32267 ExecStart=/usr/sbin/httpd $OPTIONS -DFOREGROUND (code=exited, status=1/FAILURE)
 Main PID: 32267 (code=exited, status=1/FAILURE)

Jun 06 11:31:32 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Jun 06 11:31:32 localhost.localdomain httpd[32267]: AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using localhost.localdomain. Set the 'ServerName' directive globally to suppress this message
Jun 06 11:31:32 localhost.localdomain systemd[1]: httpd.service: main process exited, code=exited, status=1/FAILURE
Jun 06 11:31:32 localhost.localdomain kill[32268]: kill: cannot find process ""
Jun 06 11:31:32 localhost.localdomain systemd[1]: httpd.service: control process exited, code=exited status=1
Jun 06 11:31:32 localhost.localdomain systemd[1]: Failed to start The Apache HTTP Server.
Jun 06 11:31:32 localhost.localdomain systemd[1]: Unit httpd.service entered failed state.
Jun 06 11:31:32 localhost.localdomain systemd[1]: httpd.service failed.
[root@localhost ~]# systemctl status httpd.service -l

[root@localhost ~]# vi /var/log/httpd/error_log
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
(13)Permission denied: AH00091: httpd: could not open error log file /var/www/mytestdeployment/error.log.
AH00015: Unable to open logs
~
"/var/log/httpd/error_log" 10L, 675C

@JeffSchaller’s suggestion


After @JeffSchaller suggested to consider SELinux, I found that typing setenforce 0 as root resulted in the following:

[root@localhost ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   enforcing
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

[root@localhost ~]# setenforce 0

[root@localhost ~]# sestatus
SELinux status:                 enabled
SELinuxfs mount:                /sys/fs/selinux
SELinux root directory:         /etc/selinux
Loaded policy name:             targeted
Current mode:                   permissive
Mode from config file:          enforcing
Policy MLS status:              enabled
Policy deny_unknown status:     allowed
Max kernel policy version:      28

[root@localhost ~]# systemctl start httpd.service -l
[root@localhost ~]# systemctl status httpd.service -l
● httpd.service - The Apache HTTP Server
   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2017-06-06 12:28:38 PDT; 22s ago
     Docs: man:httpd(8)
           man:apachectl(8)
  Process: 32577 ExecStop=/bin/kill -WINCH ${MAINPID} (code=exited, status=1/FAILURE)
 Main PID: 32690 (httpd)
   Status: "Total requests: 0; Current requests/sec: 0; Current traffic:   0 B/sec"
   CGroup: /system.slice/httpd.service
           ├─32690 /usr/sbin/httpd -DFOREGROUND
           ├─32691 /usr/sbin/httpd -DFOREGROUND
           ├─32692 /usr/sbin/httpd -DFOREGROUND
           ├─32693 /usr/sbin/httpd -DFOREGROUND
           ├─32694 /usr/sbin/httpd -DFOREGROUND
           └─32695 /usr/sbin/httpd -DFOREGROUND

Jun 06 12:28:38 localhost.localdomain systemd[1]: Starting The Apache HTTP Server...
Jun 06 12:28:38 localhost.localdomain systemd[1]: Started The Apache HTTP Server.
[root@localhost ~]#

Понравилась статья? Поделить с друзьями:
  • Error unable to open earlyerr txt
  • Error uncr victoria что это
  • Error unable to open database unable to open database file
  • Error unclosed string literal
  • Error unable to open asset kuid 30501 1010 for writing