sipcapture / homer-app

HOMER 7.x Front-End and API Server
http://sipcapture.io
GNU Affero General Public License v3.0
200 stars 77 forks source link

Webapp Server not starting. #527

Closed Gilbert2015 closed 1 year ago

Gilbert2015 commented 1 year ago

During the deployment of the webapp server using the webapp docker image, I faced an error stating that the application could not write to the log file. Here is the log output from the deployment:

"The connection to the database was successful, but the application failed to open the log file."

Pre-Flight provisioning completed! {"level":"info","msg":"init logging system","time":"2023-07-05T22:22:51Z"}  CONNECT to DB ROOT STRING: [host=devperconacluster.development.svc.cluster.local user=postgres dbname=postgres sslmode=disable port=5432 pa]  Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app_%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(*strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied  HOMER - create db [homer_config] with [name=postgres] 

(/homer-app/migration/migration.go:85) [2023-07-05 22:22:51]  pq: database "homer_config" already exists 

(/homer-app/migration/migration.go:85) [2023-07-05 22:22:51] [0.46ms] CREATE DATABASE homer_config OWNER postgres
[0 rows affected or returned ]  DONE   HOMER - show users  Role name | Attributes

homer_user  |       
pgbouncer   |       
pguser  |       
postgres    |   superuser, create database  
primaryuser |       

 DONE  {"level":"info","msg":"init logging system","time":"2023-07-05T22:22:51Z"}  CONNECT to DB ROOT STRING: [host=devperconacluster.development.svc.cluster.local user=postgres dbname=postgres sslmode=disable port=5432 password=LFjcErEEFxKIoxACytbW9Nol]  Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app_%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied  HOMER - create db [homerdata] with [name=postgres]  Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(*strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied

(/homer-app/migration/migration.go:85) [2023-07-05 22:22:51]  pq: database "homer_data" already exists 

(/homer-app/migration/migration.go:85) [2023-07-05 22:22:51] [0.48ms] CREATE DATABASE homer_data OWNER postgres
[0 rows affected or returned ]  DONE   HOMER - show users  Role name | Attributes

homer_user  |       
pgbouncer   |       
pguser  |       
postgres    |   superuser, create database  
primaryuser |       

 DONE  {"level":"info","msg":"init logging system","time":"2023-07-05T22:22:51Z"} Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app_%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied  HOMER - creating tables for the config DB [dbname=homerconfig]   DONE  Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied {"level":"info","msg":"init logging system","time":"2023-07-05T22:22:51Z"} Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied  HOMER - filling tables for the config DB [dbname=homer_config]   DONE  time="2023-07-05T22:22:51Z" level=info msg="SELECT FROM \"versions\" " module=gorm type=sql Database provisioning completed! {"level":"info","msg":"init logging system","time":"2023-07-05T22:22:51Z"} Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app_%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Successful ping: devperconacluster.development.svc.cluster.local, Type: data, Node: LocalNodeFailed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app202307050000.log: permission denied  PostgreSQL version: 14.7  Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied time="2023-07-05T22:22:52Z" level=info msg="INSERT INTO \"applications\" (\"guid\",\"name\",\"host\",\"version\",\"createdat\") VALUES ($1,$2,$3,$4,$5) ON CONFLICT (name,host) DO UPDATE SET version = EXCLUDED.version, guid = EXCLUDED.guid RETURNING \"applications\".\"id\"" module=gorm type=sql Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied 


    /__/\             
    \  \:\           
     \__\:\  
 ___ /  /::\     
/__/\  /:/\:\     _____     
\  \:\/:/__\/    |___  |    
 \  \::/            / /   
  \  \:\           / /             
   \  \:\         /_/               
    \__\/         

  Version: homer-app 1.4.56.  Failed to write to log, failed to acquite target io.Writer: failed to open file &{/usr/local/homer/homer-app_%Y%m%d%H%M.log [%!s(strftime.stdlibFormat=&{/usr/local/homer/homer-app_20060102}) %!s(strftime.hourPadded=&{48 false}) %!s(*strftime.stdlibFormat=&{04.log})]}: open /usr/local/homer/homer-app_202307050000.log: permission denied {"time":"2023-07-05T22:22:52.129626336Z","level":"FATAL","prefix":"echo","file":"main.go","line":"880","message":"Couldn't start server"}

github-actions[bot] commented 1 year ago

Your report is appreciated. Please star this repository to motivate its developers! :star:

adubovikov commented 1 year ago

Please check the permissions for /usr/local/homer directory or start the homer-app under root

Gilbert2015 commented 1 year ago

@adubovikov Thank you so much for your response. After setting the permission for /usr/local/homer, the application was able to write log file. I am now getting the error message "level":"FATAL","prefix:"echo":"file":"main.go","line":"882","message":"Couldnt start server"