I migrated the database from us-central1 to asia_southeast1. I'd like to deploy the security rule to the new database but it doesn't work. The followings are the steps I took and the result:
(The new db called abc-asia-db, the whole database URL is https://abc-asia-db.asia-southeast1.firebasedatabase.app/)
firebase target:apply database main abc-asia-db
In firebase.json Replace database script with the followings
"database":
[{"target": "main","rules": "database.rules.json"},
{"target": "other","rules": "other.rules.json"}]
firebase deploy --only database
Then, it shows the following error message:
Error: Failed to get instance details for instance: abc-asia-db. See firebase-debug.log for more details.
If I created the new database in us-central1, it works well. The security rule can be deployed successfully. However, if I create the new database in asia_southeast1, it doens't work.
I use Mac OS and can't find the debug.log in my computer. There are the only files in the folder.
drwxr-xr-x 19 xxx staff 608 Aug 27 13:16 ..
drwxr-xr-x 12 xxx staff 384 Oct 5 14:39 functions
-rw-r--r--# 1 xxx staff 644 Oct 5 15:41 database.rules.json
-rw-r--r--# 1 xxx staff 643 Oct 5 16:28 other.rules.json
-rw-r--r-- 1 xxx staff 382 Oct 5 16:47 .firebaserc
-rw-r--r-- 1 xxx staff 467 Oct 6 11:52 firebase.json
drwxr-xr-x 9 xxx staff 288 Oct 6 12:44 .
Your firebase.json is probably malformed. In the example they have only one rule file per database. In your example, I see a duplicate entry for the main database. Try using this firebase.json content as an example:
{
"database": [
{"target": "main", "rules": "database.rules.json"}
]
}
Related
I have a VueJS app hosted on Firebase, and I'm using CloudBuild to build and deploy it. My ultimate goal is to embed a version number or commit SHA into the footer of the front page, so we can always confirm which version we're seeing in the browser. Happy to hear alternate implementations, but right now I'm just trying to write a static text file.
I know each step in CloudBuild is a unique container, and only /workspace gets held over through each step. If I execute "pwd," I do see that's where all these steps take place.
I can even write the text file as shown (my date interpolation doesn't work), and see the file exists in the subsequent step. But after the final deployment, it's not there.
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args: ['-c', "echo \"$REVISION_ID (commit $COMMIT_SHA) deployed on `date`\" >> ./static/version.txt"]
- name: 'bash'
args: ['ls', '-lart', './static']
# Deploy
- name: 'gcr.io/cloud-builders/npm:node-10.10.0'
args: ['run', 'deploy']
the ls output shows this:
total 56
drwxr-xr-x 2 root root 4096 Apr 17 20:52 svg
drwxr-xr-x 2 root root 4096 Apr 17 20:52 styles
drwxr-xr-x 2 root root 4096 Apr 17 20:52 plugins
-rw-r--r-- 1 root root 442 Apr 17 20:52 manifest.json
drwxr-xr-x 2 root root 4096 Apr 17 20:52 legal
drwxr-xr-x 2 root root 4096 Apr 17 20:52 js
drwxr-xr-x 4 root root 4096 Apr 17 20:52 images
drwxr-xr-x 2 root root 4096 Apr 17 20:52 gifs
drwxr-xr-x 3 root root 4096 Apr 17 20:52 fonts
-rw-r--r-- 1 root root 6148 Apr 17 20:52 .DS_Store
drwxr-xr-x 12 root root 4096 Apr 17 20:59 ..
-rw-r--r-- 1 root root 132 Apr 17 21:00 version.txt
drwxr-xr-x 10 root root 4096 Apr 17 21:00 .
So I know the version.txt file gets written and persists across steps.
The npm run deploy step just runs firebase deploy. The app deploys, but the version.txt file gives a 404. Notably, I can navigate to <APP_ROOT>/static/manifest.json and open that file in the browser -- but since it is part of the git revision, maybe that doesn't tell me much.
Not sure how to proceed from here. Am I missing something about how CloudBuild works? Is there a better way to do this version thing?
I have Artifactory 6.20.1 running in a Docker container. I'm trying to install the artifactCleanup plugin (https://github.com/jfrog/artifactory-user-plugins/tree/master/cleanup/artifactCleanup)
I have put the artifactCleanup.groovy file in the corresponding folder:
$ ls -all /opt/jfrog/artifactory/var/etc/artifactory/plugins/
total 36
drwxr-xr-x 2 artifact artifact 4096 Feb 24 10:28 .
drwxr-xr-x 3 artifact artifact 4096 Feb 23 15:24 ..
-rwxr-xr-x 1 artifact artifact 5829 Feb 23 15:25 README.md
-rwxr-xr-x 1 artifact artifact 14043 Feb 23 15:26 artifactCleanup.groovy
-rwxr-xr-x 1 artifact artifact 325 Feb 24 10:28 artifactCleanup.json
However if I'm trying to see my loaded plugins I get an empty response
curl -X GET -u "admin:password" http://localhost:8081/artifactory/api/plugins
{}
The Server has been restarted before running that request. All commands have been running inside the Docker container. I have been looking at the documentation (https://www.jfrog.com/confluence/display/JFROG/User+Plugins) on how to install plugins. My User account which was used for the rest calls is an admin account.
Now I am out of clues, why that plugin is not loading?
You can use the below reload plugins using the Reload Plugins REST API endpoint.
https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API#ArtifactoryRESTAPI-ReloadPlugins
Please comment here if you are running into any issues.
Turns out I created a wrong directory. Correct directory is
/var/opt/jfrog/artifactory/etc/plugins
which already existed.
the code will not create the output 'imdiff' but instead will say it can't find imdiff.
dyn896-105:intro sophiejacobs$ pwd
/Users/sophiejacobs/Downloads/preCourse/intro
dyn896-105:intro sophiejacobs$ ls
LThal_mask_func.nii.gz filtered_func_data.nii.gz
LThal_mask_std.nii.gz highres.nii.gz
bighead.nii.gz image0.nii.gz
bvals image1.nii.gz
cst2standard_73_46_26.nii.gz newfmri.nii.gz
diffdata.nii.gz standard.nii.gz
egepi.nii.gz structural.nii.gz
egfmri.nii.gz sub3m0.nii.gz
example_func.nii.gz thresh_zstat1.nii.gz
example_func2highres.mat wrapped.nii.gz
example_func2standard.mat
dyn896-105:intro sophiejacobs$ fslmaths image0 -sub image1 imdiff
libc++abi.dylib: terminating with uncaught exception of type `enter code here`NiftiIO::NiftiException: Error: cant open file imdiff.nii.gz
Abort trap: 6
I expected that image1 would be subtracted from image0 and that that new image would be called imdiff
I think I had the same error and came across your post when trying to fix it
NBrMBP:intro colette$ fslmaths image0 -sub image1 imdiff
libc++abi.dylib: terminating with uncaught exception of type NiftiException: Error: cant open file imdiff.nii.gz
Luckily my supervisor was able to help.
I did not have permission to the directory/folders/files that I downloaded from the FSL tutorial website, but worked after I changed the permissions
cd to the folder that has the files you are trying to use (for me this was a folder called preCourse)
use the command: ls –la
This lists details of the files in the directory. In the left hand column it shows the permissions with dr-xr-xr-x# which means I only had permission to read the files.
e.g:
`NBrMBP:preCourse colette$ ls -la
total 16
dr-xr-xr-x# 3 colette staff 102 21 Jul 2017 fmri
dr-xr-xr-x# 23 colette staff 782 21 Jul 2017 intro`
Use the command: chmod u+w <directoryname>
Run this from the folder above the one you would need permissions from. (u=user w = writing permissions)
e.g NBrMBP:preCourse colette$ chmod u+w intro
Now use ls –la again, it should now show drwxr-xr-x# in the left hand column i
e.g.:
NBrMBP:preCourse colette$ ls -la
total 16
drwx------# 5 colette staff 170 8 Jan 11:55 .
drwxr-xr-x 4 colette staff 136 8 Jan 11:55 ..
-rw-r--r--# 1 colette staff 6148 8 Jan 11:55 .DS_Store
drwxr-xr-x# 3 colette staff 102 21 Jul 2017 fmri
drwxr-xr-x# 26 colette staff 884 8 Jan 15:51 intro
*Note you may need admin permissions on your computer to be able to change the permissions of the read/write/executability of the files.
Hope this helps anyone else who searched the error code!
My username (let’s call it my_name) belongs to the Apache group which is owner of var/www/html directory, sub-directories and files contained within.
In that directory I installed Wordpress. Directories and files permissions are set to 0775 (yeah, I know the files should have 644, but it is not a factor for now).
Well, my username has writing permissions indeed, because I am able to create new files or directories, as well as delete them, by using SSH terminal or WinSCP.
The problem comes up when I run a post-receive hook of a bare git repository, no matter if by running the script or by pushing changes from the local working repository.
In any scenario, the post-receive hook does not work because of permission denied. Really strange and I cannot understand why.
Could you help me please?
Edit:
This is the output of ls -alrth ~/git/devsite.git/hooks directory:
-rwxrwxr-x 1 name apache 896 Apr 2 22:41 commit-msg.sample
-rwxrwxr-x 1 name apache 727 Apr 7 09:09 post-receive
-rwxrwxr-x 1 name apache 189 Apr 2 22:41 post-update.sample
-rwxrwxr-x 1 name apache 398 Apr 2 22:41 pre-applypatch.sample
-rwxrwxr-x 1 name apache 1704 Apr 2 22:41 pre-commit.sample
-rwxrwxr-x 1 name apache 1239 Apr 2 22:41 prepare-commit-msg.sample
-rw-rw-r-- 1 name apache 1348 Apr 2 22:41 pre-push.sample
-rwxrwxr-x 1 name apache 4951 Apr 2 22:41 pre-rebase.sample
-rwxrwxr-x 1 name apache 3611 Apr 2 22:41 update.sample
This is the post-receive script:
#!/bin/sh
TARGET=/var/www/html/wp-content
GIT_DIR=/home/name/git/devsite.git
#run 'post-receive' hook
git --work-tree=$TARGET --git-dir=$GIT_DIR checkout -f
Try again after a
cd /path/tp/bare/repo
git config core.sharedRepository true
I mentioned it before in "Permissions with Git Post-Receive".
In the OP's instance, the post-receive script is not placed properly: it should be in ~/git/devsite.git/hooks, not ~/git/devsite.git.
I have installed Redis 3.0.6 on Debian. There's a /etc/init.d/redis file which starts the Redis server when the system starts or I can invoke it manually to start/stop the server. Problem is that this script is run as root user.
I have a redis user and group that I want to make Redis run under. But I can't figure out how (I have not found an option to make Redis switch user ID after startup). In my config file I use
unixsocket /home/redis/redis.sock
unixsocketperm 770
But, of course, the redis.sock is owned by root.
drwxr-xr-x 2 redis redis 4096 Jan 18 03:34 bin
drwxr-xr-x 2 redis redis 4096 Jan 18 03:55 data
-rw-r--r-- 1 redis redis 41638 Jan 18 03:52 redis.conf
-rw-r--r-- 1 redis redis 16348 Jan 18 03:55 redis.log
-rw-r--r-- 1 root root 5 Jan 18 03:55 redis.pid
srwxrwx--- 1 root root 0 Jan 18 03:55 redis.sock
And the process is, too.
root 7913 0.1 0.1 38016 1976 ? Ssl 03:55 0:00 /home/redis/bin/redis-server *:6379
Ultimately, I have a git user that is also in the redis group and thus should in the end have access to redis.sock. (This is for a manual deployment of GitLab CE).
How I can I configure the Redis server that way?
Update your /etc/init.d to use sudo during start service (line 33):
sudo -u redis $EXEC $CONF
You may need to cleanup old files (in /var/lib) or reset their permission to redis.