7 – Error copying file. Is there a permissions issue?

I have a process that fetches a file, then moves it (overwriting if already exists). The copy part fails, and I cannot determine why.

Here is some PHP I am using to reproduce the issue I am seeing (with output functions from Devel module):

$source = 'temporary://someFile';
$destination = 'public://profile_pictures/someFile.jpg';

# Get name of Linux user running this
$username = posix_getpwuid(posix_geteuid())('name');
dpm($username);   # nginx

dvm(file_exists($source));       # TRUE
dvm(file_exists($destination));  # TRUE

# File permissions
dpm(substr(sprintf('%o', fileperms($source)), -4));       # 0600
dpm(substr(sprintf('%o', fileperms($destination)), -4));  # 0644

# Try Drupal's copy
$r = file_unmanaged_copy($source, $destination, FILE_EXISTS_REPLACE);
dvm($r);  # FALSE

# Try PHP copy that Drupal uses internally, to see the error
dvm(copy($destination, $source));  # TRUE    ( Copy backwards works... )
dvm(copy($source, $destination));  # FALSE   ( But this doesn't work.  )

The last line gives the following error:

Warning: copy(public://profile_pictures/someFile.jpg): failed to open stream: “DrupalPublicStreamWrapper::stream_open”

So copying backwards works, but it won’t copy from temporary:// to profile_pictures. Also, if I delete public://profile_pictures/someFile.jpg first, then it works.

Permissions of files and folders:

drwxrwx--- www-data www-data temporary://
-rw------- nginx    nginx    temporary://someFile
drwxrwxr-x www-data www-data public://profile_pictures
-rw-rw-r-- nginx    nginx    public://profile_pictures/someFile.jpg

The temporary directory is a sub-folder of public://. The nginx user is in the www-data group.

Is this a permissions issue? Looking at Drupal’s requirements, I don’t see what I am doing wrong.

verify its you/purchase authentification issue with google play

for 2 weeks i came across an issue. When i try to buy something with google play, it tells me that i need to enter a 5-digit code which I get by SMS on my phone. After that it sends me on a similar screen which says Verify it’s you/Purchase verification as you see in the picture i posted. I tried everything, passwords, that 5digit code that i got earlier, card info etc. I honestly dont know what to do since i couldnt find any info about this issue so here I am. Can someone tell what do i need to put in that blank space ?enter image description here

MYSQL cluster issue: shutdown data node correctly breaks replication

I faced issue on mysql cluster (5.7.28), i shuted down properly vm6 (data nodes) and the mysql replication was broken, i’m trying to make the link bettwen the datanode down and the replication broken but i still can’t find the reason (below the relevant), is there someone who can help me to find the link

Slave: Got error 4009 ‘Cluster Failure’ from NDB Error_code: 1296 (Warning) Slave: Can’t lock file (errno: 157 – Could not connect to storage
engine) Error_code: 1015
Error running query, slave SQL thread aborted. Fix the problem, and
restart the slave SQL thread with “SLAVE START”.

server – Critical Issue – Apache2 Errors Failed to Start Ubuntu 20.04.LTS

I have been trying to install Magento 2.4.4 on a localhost server that is for testing purposes and have the Magento 2.4.2 already unzipped in the Magento2.4 folder and the Apache page shows up in the web browser but the localhost/magento2.4 does not.

Here is the error I am getting;

Feb 28 15:49:03 HyperMillhem systemd[1]: Starting The Apache HTTP Server…
Feb 28 15:49:10 HyperMillhem apachectl[905]: apache2: Syntax error on line 224 of /etc/apache2/apache2.conf: Syntax error on line 1 of /etc/apache2/sites-enabled/000-default.conf: /etc/apache2/sites-enabled/000-default.conf:1: was not closed.
Feb 28 15:49:11 HyperMillhem apachectl[889]: Action ‘start’ failed.
Feb 28 15:49:11 HyperMillhem apachectl[889]: The Apache error log may have more information.
Feb 28 15:49:11 HyperMillhem systemd[1]: apache2.service: Control process exited, code=exited, status=1/FAILURE
Feb 28 15:49:11 HyperMillhem systemd[1]: apache2.service: Failed with result ‘exit-code’.
Feb 28 15:49:11 HyperMillhem systemd[1]: Failed to start The Apache HTTP Server.

This is my apache2.conf file

# This is the main Apache server configuration file.  It contains the

#ServerRoot “/etc/apache2”

#Mutex file:${APACHE_LOCK_DIR} default

DefaultRuntimeDir ${APACHE_RUN_DIR}

PidFile ${APACHE_PID_FILE}

Timeout 300

KeepAlive On

MaxKeepAliveRequests 100

KeepAliveTimeout 5

User ${APACHE_RUN_USER}
Group ${APACHE_RUN_GROUP}

HostnameLookups Off

ErrorLog ${APACHE_LOG_DIR}/error.log

LogLevel warn

IncludeOptional mods-enabled/.load
IncludeOptional mods-enabled/
.conf

Include ports.conf

AllowOverride All
Require all granted

<Directory /usr/share>
AllowOverride None
Require all granted

<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted

#<
<FilesMatch “^.ht”>
Require all denied

LogFormat “%v:%p %h %l %u %t “%r” %>s %O “%{Referer}i” “%{User-Agent}i”” vhost_combined
LogFormat “%h %l %u %t “%r” %>s %O “%{Referer}i” “%{User-Agent}i”” combined
LogFormat “%h %l %u %t “%r” %>s %O” common
LogFormat “%{Referer}i -> %U” referer
LogFormat “%{User-agent}i” agent

IncludeOptional conf-enabled/*.conf

IncludeOptional sites-enabled/*.conf

ServerName 127.0.0.1Directory /srv/>

#

AccessFileName .htaccess

for my 000.default.conf I have ;

<VirtualHost *:80>

    ServerAdmin webmaster@localhost

    DocumentRoot /var/www/html
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all
    </Directory>
    

ServerName 127.0.0.1

I don’t know what other .conf files I need to modify.

Any help is appreciated

How to solve the issue of my query results of in my sheet?

https://docs.google.com/spreadsheets/d/1VsEvt2KnYGnlN_qHjkjPohVHF5MUqfyHD7tSk0VpkqA/edit#gid=1418057437

I have this sheet that I enter all data of patients in (Data_Entry) tab and I want these data to be sorted by Room number and bed number in the form of 00-00. For example Room 4 bed2 (4-2) and so on. I added a helper column L that modify the room/bed number in a way I remove the “-” and I multiply by 10 if the number entered has no “-” because some rooms are only one bedded room. Then I query all the data in All_patients Tab to be sorted first by unit(Column I), then by ward(Column B), then by modified Room&Bed (helper Column L). Because sorting by Column C (actual numbers like 4-3) doesn’t result in correct ascending numbers.

But I had a problem at the results in All_Patients tab that the original helper column L(Data_Entry) which is Column K in the results tab(All_Patients) doesn’t show all the values of the numbers.So, that resulted in an incorrect ascending order by room& bed number.

=ArrayFormula(IFs(REGEXMATCH(C5:C, "-"), SUBSTITUTE(C5:C,"-",""), C5:C<>"-",C5:C*10)) this formula is in L5 of (Data_ENtry)tab that modifies the room/bed numbers in actual numbers that can be sorted if needed.

=query(Data_Entry!B5:L,"select B,C,D,E,H,F,G,K,I,L where F is not null AND B<>'Ward' order by I,B,L",0) this formula is in B5 of (All_Patients) tab that brings all entry data and sort them by unit,ward,room.

Probably there is a smarter way of sorting room/bed number