spark sql permission denied user=anonymous - apache-spark

The error that returns for Spark SQL when the denied user is anonoymous:
src:hdfs://ournamenode:8020/tmp/hive/spark-root_hive_2017-02-24_00-40-48_944_8869995689545229744-1/-ext-10000/load_date=20170223/part-07262, dest: hdfs://ournamenode:8020/user/hive/warehouse/p13n.db/message_viewed_new/load_date=20170223/part-07262, Status:true
chmod: changing permissions of 'hdfs://ournamenode:8020/user/hive/warehouse/p13n.db/message_viewed_new/load_date=20170223/part-07262': Permission denied. user=anonymous is not the owner of inode=part-07262
Is there anywhere to fix it?

I'm assuming you are using beeline to run queries. One fix is to specify username using the -n option.
The problem that causes this permission denied issue is that the "spark-warehouse" directory is created under the "anonymous" user, while files in this directory are created under the user who is running the beeline command.

Related

How to resolve /bin/bash: Permission Denied

RHEL8.3 OS is being used on server, Yesterday i have accidently executed command chmod 644 /* from /usr/share/fonts directory after command execution i am not able to access server with ssh or on putty.
Admin is trying to connect to server with root user but he is getting error /bin/bash: Permission Denied.
Please suggest how to restored permissions or resolve issue.
Refer to here, 644 means you can't even execute the file, with or without root.
Permissions of 644 mean that the owner of the file has read and write access, while the group members and other users on the system only have read access.
Could you try sudo chmod 755 /* or without root chmod 755 /*?
Also, you may try this.
If nothing works, reinstalling your system will be the only choice left.

mkdir: cannot create directory ‘/mnt/var/log/spark-jobserver\r’: Permission denied

I was trying to deploy spark-jobserver on a EMR cluster, as per this documentation "https://github.com/spark-jobserver/spark-jobserver/blob/master/doc/EMR.md#configure-master-box"
Was able to install the job-server on emr, but while starting the server using ./server_start.sh on "/mnt/lib/spark-jobserver" (you can find it in my cluster), it was showing
"mkdir: cannot create directory ‘/mnt/var/log/spark-jobserver\r’: Permission denied".
I have tried to give permission to it using chmod and also tried chown command, but all of these didnt work.
Further I had also tried logging in with ec2-user, but this even didnt help.
Can you please tell what more else is needed to be done in order to get it deployed on emr, or emr is not capable of doing this.
Logs:
[hadoop#ip-10-0-0-50 spark-jobserver]$ ./server_start.sh
mkdir: cannot create directory ‘/mnt/var/log/spark-jobserver\r’: Permission denied
Did you try giving permissions recursively?
chmod -R 777 dirname

How to allow the root user to write files into HDFS

I have installed hadoop on Cent OS 7. The daemon service written in python trying to make a directory in HDFS , but getting the below permission error.
mkdir: Permission denied: user=root, access=WRITE, inode="/rep_data/store/data/":hadoop:supergroup:drwxr-xr-x
looks like my service is running under root account.
So I would like to know how do I give a permission to the root user to make directory and write files.
If you are trying to create directory under HDFS root i.e /, you may face this type of issue. You can create directories in your home, without any issues
To create directory in root, Execute command like follows
sudo hdfs hdfs dfs -mkdir /directory/name
To create directory in your HDFS home execute below command
hdfs dfs -mkdir /user/user_home/directory/name
This is probably an issue because you are not the super user.
A workaround is to enable Access Control Lists in hdfs and give permissions to your user.
To enable support for ACLs, set dfs.namenode.acls.enabled to true in the NameNode configuration.
For more info check: link

pg_upgrade oldbindir check fails

I'm trying to upgrade postgresql database from 9.1 to 9.4. I ran the 9.4 version of pg_upgrade as follows:
sudo -u postgres pg_upgrade -b <path>/postgres/9.1/bin -B <path>/postgres/9.4/bin -d <path>/9.1DBs/ -D <path>/<empty folder>
I get:
check failed for: <path>/postgres/9.1/bin Permission denied
The folder exists, I set the permissions to 777, even gave the postgres user ownership of the directory structure, but I'm still getting the same error.
Running in verbose mode does not provide any extra info.
The partition with that contains the old binaries is mounted under /media/ and I have read/write access.
Any ideas what could be causing this?
This error
check failed for: /postgres/9.1/bin Permission denied
happens because access permission on directories (x bit) need to be set in every directory in the hierarchy, from the root to the directory containing these executables files.
This is detailed at Unix.SE in:
Do the parent directory's permissions matter when accessing a subdirectory?

How can I grant all postgres permissions to my local user?

Trying to run various database commands, I got a lot of errors from postgres:
PG::InsufficientPrivilege: ERROR: permission denied to create database
ERROR: permission denied to create extension "hstore"
etc...
I can run them as the postgres user but this is annoying and finicky and will have to be repeated anytime i make a database operation. How to grant all permissions to a given user?
the following line worked to grant all permissions to my user:
sudo -u postgres psql -c "ALTER USER <username> SUPERUSER"
adapted from this thread

Resources