jalex
23 June 2023 06:21
1
Dear guys,
I am really stuck. Kindly help. I have been sourcing the internet and this forum for almost 3 months now. So request you to kindly be patient and co-operative as this is my last resort, after exhausting all other options.
The problem arises only with the Documents module.
When I upload a document (irrespective of the size), it shows as document uploaded although it doesn’t. It appears as in the below screenshot.
AH01071: Got error ‘PHP message: PHP Warning: rename(upload/1178b47d-2398-35e0-9001-64952c6f4a90,upload/1188b2a3-43e5-304d-39fc-64952c17f2a5): No such file or directory in /opt/bitnami/apache/htdocs/include/UploadStream.php on line 214’, referer: https://cms.jeevan-aadhar.org/index.php?action=DetailView&module=Contacts&record=42&offset=1&stamp=1687497409046519800
I have tried to provide as much information I could. Could someone please assist me? Any help would be highly appreciated.
Thank you so much again guys!!
I would start by trying it on the live demo to see if the same problem occurs there. Just to determine if the problem is a generic bug, or if it is a problem only in your installation.
Please share your SuiteCRM version and your PHP version - that is the basic information to always provide.
jalex
26 June 2023 04:09
3
I have had this installation for 3 years now and it worked just fine. The problems occurred since last 3 months or so. I don’t know what changed for it to cause this. But I did confirm the folder and file permissions are correct as per the SuiteCRM guide.
SuiteCRM version: 7.11.15
PHP version: 7.4.29
This is hosted on AWS Lightsail so this is the output I received
PHP 7.4.29 (cli) (built: Apr 19 2022 10:18:30) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.29, Copyright (c), by Zend Technologies
I hope this information helps.
Do you have any messages in php_errors.log
?
jalex
26 June 2023 10:26
5
These are all the errors from today… there are about a dozen of them but all the same.
[Mon Jun 26 02:34:20.696497 2023] [proxy_fcgi:error] [pid 1705:tid 140369622673152] [client 212.46.33.210:50276] AH01071: Got error ‘PHP message: PHP Warning: include(cache/smarty/templates_c/%%ED^ED5^ED5C7499%%recaptcha_disabled.tpl.php): failed to open stream: No such file or directory in /opt/bitnami/apache/htdocs/vendor/smarty/smarty/libs/Smarty.class.php on line 1270PHP message: PHP Warning: include(): Failed opening ‘cache/smarty/templates_c/%%ED^ED5^ED5C7499%%recaptcha_disabled.tpl.php’ for inclusion (include_path=’/opt/bitnami/apache/htdocs:/opt/bitnami/apache/htdocs/include/…:.:/opt/bitnami/php/lib/php’) in /opt/bitnami/apache/htdocs/vendor/smarty/smarty/libs/Smarty.class.php on line 1270’
I am also attached the error log for your convenience
error_log.zip (2.0 KB)
If you see anything mentioning stream_metadata is not implemented
, then go here
salesagility:hotfix
← chris001:patch-30
opened 08:30PM - 07 Apr 23 UTC
PHP 5.4+ requires you implement `stream_metadata()` for upload stream!
<!--… - Please be aware that as of the 31st January 2022 we no longer support 7.10.x.
New PRs to hotfix-7.10.x will be invalid. If your fix is still applicable to 7.12.x,
please create the pull request to the hotfix branch accordingly. -->
## Description
## Motivation and Context
PHP 5.4+ requires you implement `stream_metadata()` for upload stream!
## How To Test This
Import a csv file of Accounts, Contacts, etc.
There should be no error in the logs "`Caught error: stat(): stat failed for upload/import/status_1.csv`" or
"`Caught error: touch(): UploadStream::stream_metadata is not implemented!`"
## Types of changes
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
### Final checklist
- [x] My code follows the code style of this project found [here](https://docs.suitecrm.com/community/contributing-code/coding-standards/).
- [ ] My change requires a change to the documentation.
- [x] I have read the [**How to Contribute**](https://docs.suitecrm.com/community/contributing-code/) guidelines.
otherwise, I am not sure what to recommend. Just double-check the whole linux permissions/ownerships issue, sometimes it gets tricky…
jalex
26 June 2023 11:27
7
My dear pgr… hahaha…
So I tried to reinforce the permissions and suddenly I broke the whole thing… Since I am on Lightsail the system user and group name is bitnami. I ran the below -
sudo chown -R bitnami:bitnami .
sudo chmod -R 755 .
sudo chmod -R 775 cache custom modules themes data upload
sudo chmod -R 775 config_override.php 2>/dev/null
But now my site is completely down and I get this page .
I wrote “double-check”, not “break everything”!
The issue is normally because of the ownerships.
You need to find out which user your web server is using to run, try looking through the processes listed with ps -ef
Then use that for the ownerships (chown command).
jalex
26 June 2023 12:03
9
HAHAHAHA… no im not accusing you of anything… I really appreciate all the time you take
So I ran ps-ef and this is what I received -
UID PID PPID C STIME TTY TIME CMD
root 1 0 0 11:15 ? 00:00:02 /sbin/init
root 2 0 0 11:15 ? 00:00:00 [kthreadd]
root 3 2 0 11:15 ? 00:00:00 [rcu_gp]
root 4 2 0 11:15 ? 00:00:00 [rcu_par_gp]
root 6 2 0 11:15 ? 00:00:00 [kworker/0:0H-kblockd]
root 7 2 0 11:15 ? 00:00:00 [kworker/u30:0-events_unbound]
root 8 2 0 11:15 ? 00:00:00 [mm_percpu_wq]
root 9 2 0 11:15 ? 00:00:00 [ksoftirqd/0]
root 10 2 0 11:15 ? 00:00:00 [rcu_sched]
root 11 2 0 11:15 ? 00:00:00 [rcu_bh]
root 12 2 0 11:15 ? 00:00:00 [migration/0]
root 13 2 0 11:15 ? 00:00:00 [kworker/0:1-events]
root 14 2 0 11:15 ? 00:00:00 [cpuhp/0]
root 15 2 0 11:15 ? 00:00:00 [kdevtmpfs]
root 16 2 0 11:15 ? 00:00:00 [netns]
root 17 2 0 11:15 ? 00:00:00 [kauditd]
root 18 2 0 11:15 ? 00:00:00 [khungtaskd]
root 19 2 0 11:15 ? 00:00:00 [oom_reaper]
root 20 2 0 11:15 ? 00:00:00 [writeback]
root 21 2 0 11:15 ? 00:00:00 [kcompactd0]
root 22 2 0 11:15 ? 00:00:00 [ksmd]
root 23 2 0 11:15 ? 00:00:00 [khugepaged]
root 24 2 0 11:15 ? 00:00:00 [crypto]
root 25 2 0 11:15 ? 00:00:00 [kintegrityd]
root 26 2 0 11:15 ? 00:00:00 [kblockd]
root 27 2 0 11:15 ? 00:00:00 [xen-balloon]
root 28 2 0 11:15 ? 00:00:00 [watchdogd]
root 29 2 0 11:15 ? 00:00:00 [kworker/u30:1-events_unbound]
root 31 2 0 11:15 ? 00:00:00 [kswapd0]
root 48 2 0 11:15 ? 00:00:00 [kthrotld]
root 49 2 0 11:15 ? 00:00:00 [xenbus]
root 50 2 0 11:15 ? 00:00:00 [xenwatch]
root 51 2 0 11:15 ? 00:00:00 [ipv6_addrconf]
root 60 2 0 11:15 ? 00:00:00 [kstrp]
root 99 2 0 11:15 ? 00:00:00 [ata_sff]
root 100 2 0 11:15 ? 00:00:00 [scsi_eh_0]
root 101 2 0 11:15 ? 00:00:00 [scsi_tmf_0]
root 102 2 0 11:15 ? 00:00:00 [scsi_eh_1]
root 103 2 0 11:15 ? 00:00:00 [scsi_tmf_1]
root 166 2 0 11:15 ? 00:00:00 [kworker/u31:0]
root 168 2 0 11:15 ? 00:00:00 [jbd2/xvda1-8]
root 169 2 0 11:15 ? 00:00:00 [ext4-rsv-conver]
root 211 2 0 11:15 ? 00:00:00 [kworker/0:1H-kblockd]
root 228 1 0 11:15 ? 00:00:00 /lib/systemd/systemd-journald
root 241 1 0 11:15 ? 00:00:00 /lib/systemd/systemd-udevd
root 320 1 0 11:15 ? 00:00:00 /usr/sbin/haveged --Foreground -
root 344 1 0 11:15 ? 00:00:00 /sbin/dhclient -4 -v -i -pf /run
root 423 1 0 11:15 ? 00:00:00 /sbin/dhclient -6 -v -pf /run/dh
root 514 1 0 11:15 ? 00:00:00 /usr/sbin/cron -f
message+ 515 1 0 11:15 ? 00:00:00 /usr/bin/dbus-daemon --system –
root 516 1 0 11:15 ? 00:00:00 /usr/sbin/rsyslogd -n -iNONE
root 519 1 0 11:15 ? 00:00:00 /lib/systemd/systemd-logind
_chrony 552 1 0 11:15 ? 00:00:00 /usr/sbin/chronyd -F -1
_chrony 554 552 0 11:15 ? 00:00:00 /usr/sbin/chronyd -F -1
daemon 556 1 0 11:15 ? 00:00:00 /usr/sbin/atd -f
root 557 1 0 11:15 ? 00:00:00 /usr/sbin/sshd -D
root 560 1 0 11:15 ? 00:00:00 /usr/bin/python3 /usr/share/unat
root 649 1 0 11:15 ? 00:00:00 php-fpm: master process (/opt/bi
root 653 557 0 11:15 ? 00:00:00 sshd: bitnami [priv]
daemon 660 649 0 11:15 ? 00:00:00 php-fpm: pool www
daemon 661 649 0 11:15 ? 00:00:00 php-fpm: pool www
daemon 662 649 0 11:15 ? 00:00:00 php-fpm: pool www
daemon 663 649 0 11:15 ? 00:00:00 php-fpm: pool www
daemon 664 649 0 11:15 ? 00:00:00 php-fpm: pool www
bitnami 666 1 0 11:15 ? 00:00:00 /lib/systemd/systemd --user
bitnami 667 666 0 11:15 ? 00:00:00 (sd-pam)
bitnami 681 653 0 11:15 ? 00:00:00 sshd: bitnami@pts/0
bitnami 682 681 0 11:15 pts/0 00:00:00 -bash
root 699 1 0 11:15 ? 00:00:00 /opt/bitnami/apache/bin/httpd -f
daemon 701 699 0 11:15 ? 00:00:00 /opt/bitnami/apache/bin/httpd -f
daemon 702 699 0 11:15 ? 00:00:00 /opt/bitnami/apache/bin/httpd -f
mysql 973 1 0 11:15 ? 00:00:00 /opt/bitnami/mariadb/sbin/mysqld
daemon 996 699 0 11:15 ? 00:00:00 /opt/bitnami/apache/bin/httpd -f
daemon 1128 649 0 11:15 ? 00:00:00 php-fpm: pool www
root 1129 2 0 11:15 ? 00:00:00 [kworker/0:2-events]
root 1144 1 0 11:15 ? 00:00:00 /opt/bitnami/gonit/bin/gonit
daemon 1151 649 0 11:15 ? 00:00:00 php-fpm: pool www
daemon 1243 649 0 11:18 ? 00:00:00 php-fpm: pool www
daemon 1257 649 0 11:20 ? 00:00:00 php-fpm: pool www
daemon 1260 649 0 11:20 ? 00:00:00 php-fpm: pool www
bitnami 1518 682 0 12:01 pts/0 00:00:00 ps -ef
jalex
26 June 2023 12:05
10
can you please tell me which one is the user and which the group? and I will set the ownership right at once.
pgr
26 June 2023 12:06
11
So, apache is your web server, and it’s running as “daemon”
Your chown will probably be
chown -R bitnami:daemon .
or
chown -R daemon:bitnami .
Of course you can read Bitnami docs to make sure
1 Like
jalex
26 June 2023 12:08
12
Yes chown -R bitnami:daemon . fixed it
HAHAHAHHAA
what a sigh of relief… now back to square 1…
Thank you so much pgr for helping me with this… ill try to figure out why my document module isn’t working
jalex
26 June 2023 12:10
13
This also fixed the upload issue… thank you so much sir
1 Like