Adicionado por Carlos Henrique Candido aproximadamente 24/06/2015 18:57 h
Ao anexarmos um documento externo em um processo, estamos encontrando um erro. O passos para tanto, são os seguintes:
1 – em um processo, foi anexado um documento gerado pelo SEI e foi atribuída uma numeração para ele, digamos o número nnnn1.
2 – tentamos anexar um documento externo; a tela de cadastramento é aberta, clicamos em selecionar arquivo e há a indicação de que o mesmo foi anexado.
3 – ao salvar as alterações, é exibida uma tela em branco (no Firefox) ou uma tela com mensagem de erro (no Internet Explorer); olhando o log do apache encontramos um erro 500, porém no log do SEI nada é registrado.
4 – este arquivo anexado deveria receber a numeração 2, porém não é listado como um dos documentos que está anexado ao processo.
5 – ao incluir um novo documento interno (que deveria receber a numeração nnnn2, já que o documento enviado não aparece na hierarquia do processo), este recebe a numeração nnnn3.
6 – pesquisando no diretório /upload do diretório de instalação do SEI, temos o documento enviado, salvo neste diretório, com um “hash” como nome.
7 - no arquivo de ConfiguracaoSEI.php, foi atribuído o valor '/dados' à chave 'RepositorioArquivos', indicando o diretório aonde os documentos serão salvos, de acordo como o manual de instalação.
8 - o diretório /upload, foi criados abaixo do diretório /sei. O diretório /dados foi criado na raiz do disco local do servidor. Todos os diretórios tem permissão de escrita e leitura pelo usuário apache e grupo apache. Diante da suspeita de que o erro fosse provocado por falta de permissão de escrita nos diretórios /dados e /upload, foi atribuida permissão de escrita e leitura para qualquer usuário.
Alguém tem idéia do que pode acontecer?
Obrigado.
1414 comentários
Adicionado por Marcelo Linhares
- além da permissão de leitura e escrita, coloque permissão de execução para o apache nos dois diretórios.
Adicionado por Marcelo Souza
Adicionado por Marcelo Linhares
execute como root por favor: mkdir -p /dados/2015/06/26
chown -R apache:apache /dados
chmod -R 777 /dados tail -f /var/log/httpd/*error* Execute a operação de anexo e, caso tenha insucess, nos informe o resultado do tail. abcs,
Marcelo
Adicionado por Carlos Henrique Candido
- Criado o diretório (já existia o diretório /dados/
- Alterada as permissões do diretório com escrita, leitura e execução para usuário apache, grupo apache e outros.
- SELinux está desabilitado.
- Tanto o log do Apache, quanto o log do SEI não acusam erro algum.
- Ao anexar um arquivo, dependendo do navegador, aparece, ou não uma mensagem de erro 500 do servidor.
- no diretório /var/www/html/sei/upload/, onde os arquivos temporários são escritos, o stream de dados recebido pelo servidor é escrito com sucesso, porém o mesmo não é escrito no diretório /dados/. O que aparentemente ocorre é que o servidor recebe o stream, salva no diretório temporário, mas não consegue fazer a gravação “definitiva” no diretório dados.
Instalei e habilitei o xdebug no servidor e o próximo passo é fazer o debug remoto da aplicação para descobrir aonde está ocorrendo a falha. Trecho do ConfigSEI.php: return array( 'SEI' => array(
'URL' => 'http://rj-appsei-01.ancinerj.gov.br/sei',
'Producao' => true,
'RepositorioArquivos' => '/dados'), 'PaginaSEI' => array(
'NomeSistema' => 'SEI',
'NomeSistemaComplemento' => 'Sistema Eletrônico de Informações',
'LogoMenu' => ''), [root@rj-appsei-01 /]# sestatus
SELinux status: disabled
[root@rj-appsei-01 /]# [root@rj-appsei-01 /]# ls -la dados
total 4
drwxrwxrwx 3 apache apache 17 Jun 26 16:23 .
drwxr-xr-x. 18 root root 4096 Jun 24 19:03 ..
drwxrwxrwx 3 apache apache 15 Jun 26 16:23 2015
[root@rj-appsei-01 /]# [root@rj-appsei-01 /]# mkdir p /dados/2015/06/26
[root@rj-appsei-01 /]# chown -R apache:apache /dados
[root@rj-appsei-01 /]# chmod -R 777 /dados
[root@rj-appsei-01 /]# tail -f /var/log/httpd/*error*
> /var/log/httpd/error_log <
[Fri Jun 26 14:45:28.856494 2015] [lbmethod_heartbeat:notice] [pid 18695] AH02282: No slotmem from mod_heartmonitor
[Fri Jun 26 14:45:28.859577 2015] [mpm_prefork:notice] [pid 18695] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.6.9 configured - resuming normal operations
[Fri Jun 26 14:45:28.859601 2015] [core:notice] [pid 18695] AH00094: Command line: '/usr/sbin/httpd D FOREGROUND'
[Fri Jun 26 15:07:24.451596 2015] [mpm_prefork:notice] [pid 18695] AH00170: caught SIGWINCH, shutting down gracefully
[Fri Jun 26 15:07:25.525915 2015] [suexec:notice] [pid 18748] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domainname, using fe80::250:56ff:febc:1336. Set the 'ServerName' directive globally to suppress this message
[Fri Jun 26 15:07:25.550366 2015] [auth_digest:notice] [pid 18748] AH01757: generating secret for digest authentication ...
[Fri Jun 26 15:07:25.558035 2015] [lbmethod_heartbeat:notice] [pid 18748] AH02282: No slotmem from mod_heartmonitor
[Fri Jun 26 15:07:25.561143 2015] [mpm_prefork:notice] [pid 18748] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.6.9 configured - resuming normal operations
[Fri Jun 26 15:07:25.561164 2015] [core:notice] [pid 18748] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
> /var/log/httpd/error_log-20150531 <
[Fri May 29 19:11:24.599945 2015] [auth_digest:notice] [pid 10725] AH01757: generating secret for digest authentication ...
[Fri May 29 19:11:24.600932 2015] [lbmethod_heartbeat:notice] [pid 10725] AH02282: No slotmem from mod_heartmonitor
[Fri May 29 19:11:24.626373 2015] [mpm_prefork:notice] [pid 10725] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.4.16 configured -- resuming normal operations
[Fri May 29 19:11:24.626401 2015] [core:notice] [pid 10725] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND'
[Fri May 29 19:11:31.162276 2015] [:error] [pid 10727] [client 10.1.121.68:54547] PHP Warning: mysqli::mysqli(): (HY000/2003): Can't connect to MySQL server on '10.1.124.78' (113) in /var/www/html/banco.php on line 3
[Fri May 29 19:11:31.162390 2015] [:error] [pid 10727] [client 10.1.121.68:54547] PHP Warning: mysqli::query(): Couldn't fetch mysqli in /var/www/html/banco.php on line 4
[Fri May 29 19:11:31.162401 2015] [:error] [pid 10727] [client 10.1.121.68:54547] PHP Fatal error: Call to a member function fetch_assoc() on a non-object in /var/www/html/banco.php on line 5
[Fri May 29 19:30:46.642248 2015] [:error] [pid 10728] [client 10.1.121.68:54734] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_tim ezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your time zone. in /var/www/html/version.php on line 1
[Sun May 31 03:40:06.678264 2015] [mpm_prefork:notice] [pid 10725] AH00171: Graceful restart requested, doing restart
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:febc:1336. Set the 'ServerName' directive globally to suppress this message > /var/log/httpd/error_log-20150607 <
[Fri Jun 05 10:32:40.206871 2015] [:error] [pid 1065] [client 10.1.124.76:33417] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 05 10:35:41.587058 2015] [:error] [pid 1064] [client 10.1.121.68:49276] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_time zone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/version.php on line 1
[Fri Jun 05 10:38:56.553122 2015] [:error] [pid 1064] [client 10.1.124.76:33469] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 05 17:23:27.286378 2015] [:error] [pid 1067] [client 10.1.124.76:33786] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 05 18:29:48.037968 2015] [:error] [pid 1123] [client 10.1.121.68:53100] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_time zone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/version.php on line 1
[Fri Jun 05 18:34:39.076469 2015] [:error] [pid 7309] [client 10.1.121.68:53234] PHP Warning: phpinfo(): It is not safe to rely on the system's timezone settings. You are required to use the date.timezone setting or the date_default_time zone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/version.php on line 1
[Fri Jun 05 18:37:48.635622 2015] [:error] [pid 1065] [client 10.1.124.76:33852] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in unknown on line 0
[Fri Jun 05 18:50:02.345035 2015] [:error] [pid 1067] [client 10.1.124.76:33869] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Sun Jun 07 03:44:07.325603 2015] [mpm_prefork:notice] [pid 1061] AH00171: Graceful restart requested, doing restart AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:febc:1336. Set the 'ServerName' directive globally to suppress this message > /var/log/httpd/error_log-20150615 <
[Fri Jun 12 18:10:42.266473 2015] [:error] [pid 14874] [client 10.1.124.76:44631] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:11:04.735669 2015] [:error] [pid 14753] [client 10.1.124.76:44641] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set 'always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:11:19.839682 2015] [:error] [pid 14758] [client 10.1.124.76:44650] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:12:48.489578 2015] [:error] [pid 14760] [client 10.1.124.76:44661] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:14:00.152349 2015] [:error] [pid 14753] [client 10.1.124.76:44672] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:14:24.791048 2015] [:error] [pid 14758] [client 10.1.124.76:44681] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:17:22.327897 2015] [:error] [pid 14834] [client 10.1.124.76:44690] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Fri Jun 12 18:18:05.084136 2015] [:error] [pid 14758] [client 10.1.124.76:44699] PHP Deprecated: Automatically populating $HTTP_RAW_POST_DATA is deprecated and will be removed in a future version. To avoid this warning set ‘always_populate_raw_post_data' to '-1' in php.ini and use the php://input stream instead. in Unknown on line 0
[Mon Jun 15 03:35:07.095890 2015] [mpm_prefork:notice] [pid 14748] AH00171: Graceful restart requested, doing restart
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:febc:1336. Set the 'ServerName' directive globally to suppress this message > /var/log/httpd/error_log-20150621 <
[Wed Jun 17 18:10:15.751190 2015] [core:notice] [pid 3701] AH00094: Command line: '/usr/sbin/httpd D FOREGROUND'
[Wed Jun 17 18:15:23.236633 2015] [mpm_prefork:notice] [pid 3701] AH00170: caught SIGWINCH, shutting down gracefully
[Wed Jun 17 18:15:24.346261 2015] [suexec:notice] [pid 3719] AH01232: suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:febc:1336. Set the 'ServerName' directive globally to suppress this message
[Wed Jun 17 18:15:24.395596 2015] [auth_digest:notice] [pid 3719] AH01757: generating secret for digest authentication ...
[Wed Jun 17 18:15:24.410866 2015] [lbmethod_heartbeat:notice] [pid 3719] AH02282: No slotmem from mod_heartmonitor
[Wed Jun 17 18:15:24.418536 2015] [mpm_prefork:notice] [pid 3719] AH00163: Apache/2.4.6 (Red Hat Enterprise Linux) PHP/5.6.9 configured - resuming normal operations
[Wed Jun 17 18:15:24.418583 2015] [core:notice] [pid 3719] AH00094: Command line: '/usr/sbin/httpd -D FOREGROUND
[Sun Jun 21 03:14:01.714633 2015] [mpm_prefork:notice] [pid 3719] AH00171: Graceful restart requested, doing restart AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using fe80::250:56ff:febc:1336. Set the 'ServerName' directive globally to suppress this message portal.softwarepublico.gov.br/social/sei/foruns/logaplicacaosei.png portal.softwarepublico.gov.br/social/sei/foruns/resultadouploadarquivoexterno.png
Adicionado por Marcelo Linhares
20208642
Adicionado por Carlos Henrique Candido
O que vi no site do php.net, porém, é que a versão 5.3 atingiu o final de vida e não é mais suportada. [root@rj-appsei-01 admin]# yum list installed php\*
Plugins carregados: product-id, subscription-manager
Pacotes instalados
php-cli.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-common.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-gd.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-imap.x86_64 5.4.16-3.el7 @epel
php-ldap.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-mysql.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-odbc.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-pdo.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-pear.noarch 1:1.9.4-21.el7 @rhel-7-server-rpms
php-pecl-memcache.x86_64 3.0.8-4.el7 @rhel-7-server-rpms
php-process.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-soap.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-xml.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
php-xmlrpc.x86_64 5.4.16-23.el7_0.3 @rhel-7-server-rpms
[root@rj-appsei-01 admin]#
Adicionado por Marcelo Linhares
Adicionado por Marcelo Linhares
Ele fez um teste com php-5.4 no CentOS6.5 e funcionou normalmente o upload de arquivos. Sendo assim, como vc usa o php5.4 acho que pode descartar essa hipótese do php5.3. No momento não tenho nenhuma outra sugestão a não ser tentar mapear o problema debugando linha a linha.
Se conseguir liberar o acesso remoto terei prazer em tentar ajudar. Ou estamos disponíveis caso queira nos visitar para verificar as nossas instalações/configurações.
Adicionado por Carlos Henrique Candido
Seria possível disponibilizar uma imagem da máquina onde vocês rodam o SEI?
Caso não seja possível, poderiam repassar as configurações da máquina? Gostaríamos de saber qual o SO (CentOS, pelo que entendi), qual a versão, qual o filesystem
utilizado, configurações do iptables (caso esteja ativo), configurações do SELinux (caso estejam utilizando), versão do apache e do PHP.
Adicionado por Marcelo Linhares
Os repositórios são base e tb da Epel A infra é núvem OpenStack e fica no Serpro RJ.
Filesystem das máquinas é LVM e adicionamos um disco para os anexos que ficam em um NFS com partição EXT4 Apache 2.2.x
php 5.3.x
mysql 5.1.x comunity (estamos migrando para 5.5) Vamos providenciar uma imagem Centos 6.5. Se quiser marque um dia para vir aqui que podemos demonstrar. Podemos inclusive fazer uma instalação do zero para tirar eventuais dúvidas. Att,
Marcelo
20208642
Adicionado por Carlos Henrique Candido
Conseguimos chegar ao ponto em que a execução não avança.
Dentro da classe DocumentoRN.php existe um método chamado receberRN0991 na qual colocamos vários "echo" para verificar se a execução avançava.
Segue o trecho do código com os "echo" no código: public function receberRN0991(DocumentoDTO $objDocumentoDTO){ $bolAcumulacaoPrevia = FeedSEIProtocolos::getInstance()->isBolAcumularFeeds(); echo('&lt;br&gt;passo 1'); FeedSEIProtocolos::getInstance()->setBolAcumularFeeds(true); echo('&lt;br&gt;passo 2'); $objDocumentoDTO = $this->receberRN0991Interno($objDocumentoDTO); echo('&lt;br&gt;passo 3'); $objIndexacaoDTO = new IndexacaoDTO();
$objIndexacaoRN = new IndexacaoRN(); echo('&lt;br&gt;passo 4'); $objProtocoloDTO = new ProtocoloDTO();
$objProtocoloDTO->setDblIdProtocolo($objDocumentoDTO->getDblIdDocumento()); (...) Na tela, aparecem os passo 1 e passo 2, porém não aparece o passo 3 e subsequentes, o que parecia ser algum problema no método receberRN0991Interno.
Pesquisando em todo o projeto, não encontrei este método. O que encontrei foi o seguinte método: protected function receberRN0991InternoControlado(DocumentoDTO $objDocumentoDTO) {
try{ //Valida Permissao
SessaoSEI::getInstance()->validarAuditarPermissao('documento_receber',__METHOD__,$objDocumentoDTO); //Regras de Negocio
$objInfraException = new InfraException(); $objDocumentoDTO->setStrStaProtocoloProtocolo(ProtocoloRN::$TP_DOCUMENTO_RECEBIDO);
(...) Segue em anexo o arquivo incluido no pacote que utilizamos na instalação do SEI.
Se possível, pode comparar com a versão que vocês utilizam? Obrigado! portal.softwarepublico.gov.br/social/sei/foruns/documentorn.php
Adicionado por Carlos Henrique Candido
Conseguimos habilitar os logs detalhados do PHP e encontramos o seguinte ero ao tentar anexar um arquivo externo ao processo: [08-Jul-2015 16:37:26 America/Sao_Paulo] PHP Fatal error: Call to undefined function finfo_open() in /var/www/html/sei/rn/AnexoRN.php on line 84
[08-Jul-2015 16:37:26 America/Sao_Paulo] PHP Stack trace:
[08-Jul-2015 16:37:26 America/Sao_Paulo] PHP 1. {main}() /var/www/html/sei/controlador.php:0
[08-Jul-2015 16:37:26 America/Sao_Paulo] PHP 2. require_once() /var/www/html/sei/controlador.php:231 Pesquisando, pelo erro "Call to undefined function finfo_open()" este aparece relacionado ao uso do módulo fileinfo.
No comando de configuração do PHP existente no manual de instalação do SEI, existe uma opção '--disable-fileinfo'. Tentamos recompilar o PHP habilitando a chave com o uso da opção '--enable-fileinfo', porém após duas tentativas, o erro persiste e quando executamos o comando phpinfo(), a opção consintua constando como '--disable-fileinfo'.
Existe algum outro passo, que não conste do manual, que deve ser executado para habilitar o módulo fileinfo?