Why I got errors running redis in laravel app? - laravel

I need to run laravel 5 app on my local Kubuntu 18 and I need to run redis server for this app
I installed and in file /etc/redis/redis.conf I uncommented line :
requirepass foobared
in .env I modified redis config :
REDIS_HOST=http://127.0.0.1:8000 # I run app with command : php artisan serve
REDIS_PASSWORD=foobared
REDIS_PORT=6379 # default port
I restarted redis and check status:
$ sudo service redis status
[sudo] password for serge:
● redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; enabled; vendor preset: enabled)
Active: active (running) since Fri 2021-02-26 13:52:09 EET; 6min ago
Docs: http://redis.io/documentation,
man:redis-server(1)
Process: 1545 ExecStop=/bin/kill -s TERM $MAINPID (code=exited, status=0/SUCCESS)
Process: 1548 ExecStart=/usr/bin/redis-server /etc/redis/redis.conf (code=exited, status=0/SUCCESS)
Main PID: 1574 (redis-server)
Tasks: 4 (limit: 4915)
CGroup: /system.slice/redis-server.service
└─1574 /usr/bin/redis-server 127.0.0.1:6379
Feb 26 13:52:08 AtHome systemd[1]: Starting Advanced key-value store...
Feb 26 13:52:09 AtHome systemd[1]: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid (yet?) after start: No such file or directory
Feb 26 13:52:09 AtHome systemd[1]: Started Advanced key-value store.
I see that file Can't open PID file not found above
But I have this file:
root#AtHome:/run/redis# ls -la
total 4
drwxr-sr-x 2 redis redis 60 Feb 26 14:32 .
drwxr-xr-x 38 root root 1160 Feb 26 14:32 ..
-rw-rw---- 1 redis redis 6 Feb 26 14:32 redis-server.pid
root#AtHome:/run/redis# cat redis-server.pid
22676
aand I got error on next command :
$ laravel-echo-server start
Error: The config file could not be found.
Is this errors as PID file was not found above?
How can it be fixed?
In composer.json :
"laravel/framework": "5.5.*",
"predis/predis": "^1.1",
MODIFIED # :
In /etc/redis/redis.conf I found
pidfile /var/run/redis/redis-server.pid
When I installed the ubuntu I installed /var on separate partition, so I have in /etc/fstab :
UUID=e531d8c5-530c-4533-a949-9fd5a62e0821 / ext4 errors=remount-ro 0 1
# /boot was on /dev/sdb1 during installation
UUID=23cc34a1-2be9-43b1-9c79-8e53af7bc799 /boot ext4 defaults 0 2
# /var was on /dev/sdb5 during installation
UUID=57c14b70-da85-4c5b-be6f-45174147d987 /var ext4 defaults 0 2
that is why /var/run/redis/redis-server.pid looks like /run/redis/redis-server.pid in my console command.
I do not know can that be key of this problem? How can it be salved ?
MODIFIED # 2 :
Yes, redis started and it shows in status command :
Active: active (running)
I see error message
Feb 26 13:52:09 AtHome systemd[1]: redis-server.service: Can't open PID file /var/run/redis/redis-server.pid
I do not know how critical is it ?
I need to run in the root of my app laravel-echo-server for redis working
but I got error :
$ laravel-echo-server start
Error: The config file could not be found.
I suppose that 2) depends on 1), but not sure, I am new in redis and very common
knowledge about laravel-echo-server...
MODIFIED # 3 :
Searching how test redis I found how made tests, but looks like not all works properly :
app_root$ redis-cli
127.0.0.1:6379> set greetings "Hello World!"
(error) NOAUTH Authentication required.
127.0.0.1:6379> get greetings
(error) NOAUTH Authentication required.
127.0.0.1:6379> exit
app_root$ sudo systemctl restart redis
[sudo] password for serge:
app_root$ redis-cli
127.0.0.1:6379> get greetings
(error) NOAUTH Authentication required.
127.0.0.1:6379>
But I am still not sure if it is reason that I got error running laravel-echo-server
Thanks!

Related

ERROR: (gcloud.auth.activate-service-account) The .json key file is not in a valid format -- via impersonate-service-account

Is it possible to use short-lived credentials, with docker-compose, to run a bash scripted gcloud command?
Related posts that I attempted to use but they are 5+ years old and I've been led to believe that the gcloud auth command has changed during this time:
ERROR: (gcloud.auth.activate-service-account) Failed to activate the given service account. Please ensure provided key file is valid
gcloud auth activate-service-account [ERROR] Please ensure provided key file is valid
Setup
there is a lot going on but I've attempted to abbreviate to the relevant parts
Makefile
auth: ## commands for short lived auth
#gcloud config set project ${GCP_PROJECT}
#gcloud auth application-default login --impersonate-service-account="inst-dataflow-svc#${GCP_PROJECT}.iam.gserviceaccount.com"
#gcloud auth configure-docker $(REGION)-docker.pkg.dev
gcloud-flex-build: ## build & push base docker image
docker-compose build gcloud-build-flex-local
docker-compose run gcloud-build-flex-local
docker-compose.yaml
version: '3.4'
services:
gcloud-build-flex-local:
build:
dockerfile: docker/gcloud-build-flex-template.dockerfile
context: .
image: us-central1-docker.pkg.dev/gcp-project/dataflow-docker-registry/local-build/pubsub-to-gbq-build-flex-template
volumes:
- type: bind
source: ${HOME}/.config/gcloud/
target: /tmp
docker/gcloud-build-flex-template.dockerfile
FROM gcr.io/google.com/cloudsdktool/cloud-sdk:408.0.1
COPY docker/scripts/gcloud-build-flex-template.sh /app/gcloud-build-flex-template.sh
COPY dataflow/pubsub-to-gbq/pubsub-to-gbq-metadata /app/pubsub-to-gbq-metadata
WORKDIR /app
ENTRYPOINT "/app/gcloud-build-flex-template.sh"
/app/gcloud-build-flex-template.sh
#!/bin/bash
set -euo pipefail
SERVICE_ACCOUNT_EMAIL=inst-dataflow-svc#gcp-project.iam.gserviceaccount.com
GCP_PROJECT=gcp-project
export GOOGLE_APPLICATION_CREDENTIALS=/tmp/application_default_credentials.json
# debugging
echo $GOOGLE_APPLICATION_CREDENTIALS
ls -lah /tmp/
cat $GOOGLE_APPLICATION_CREDENTIALS
gcloud auth activate-service-account $SERVICE_ACCOUNT_EMAIL --project=$GCP_PROJECT --key-file=$GOOGLE_APPLICATION_CREDENTIALS
Execution
make auth
make gcloud-flex-build
Error
ERROR: (gcloud.auth.activate-service-account) The .json key file is not in a valid format.
make: *** [gcloud-flex-build] Error 1
stdout (abbreviated)
docker-compose build gcloud-build-flex-local
[+] Building 0.4s (9/9) FINISHED
...
docker-compose run gcloud-build-flex-local
drwxr-xr-x 17 root root 544 Dec 30 10:36 .
drwxr-xr-x 1 root root 4.0K Dec 30 10:40 ..
-rw------- 1 root root 591 Dec 30 10:36 application_default_credentials.json
{
"delegates": [],
"service_account_impersonation_url": "https://iamcredentials.googleapis.com/v1/projects/-/serviceAccounts/inst-dataflow-svc#gcp-project.iam.gserviceaccount.com:generateAccessToken",
"source_credentials": {
"client_id": "alphanumeric string .apps.googleusercontent.com",
"client_secret": "alphanumeric string",
"refresh_token": "alphanumeric string",
"type": "authorized_user"
},
"type": "impersonated_service_account"
}
I can make it work via docker run by spoofing the credentials to include only the "source_credentials" object, passed in as a volume, but this same trick doesn't seem to work with docker-compose running a script inside a container...
There is a similar type of configuration mentioned in this document. This involves three major steps:
Create short-lived credentials for your service account and download
your service account keys.
Create the configuration files for making your docker environment up. Use
the above cred files for granting required permissions.
Once you have all the configuration files in place use your docker-compose
commands for making your environment up.
Follow this documentation for more details.

Gitlab Runner 403 forbidden error on Nuget Push

I am trying to prepare a CI pipeline that ll pack and push the .dll to My custom nuget server on every commit.
.gitlab-ci.yml:
image: microsoft/dotnet:latest
stages:
- build
- pack
- push
variables:
project: "GitlabCITest"
before_script:
- "dotnet restore"
- "ls -al /builds/test/gitlabcitest/GitlabCITest/nuget.exe"
build:
stage: build
variables:
build_path: "./"
script:
- "dotnet build"
pack:
stage: pack
script:
- "cd GitlabCITest"
- "mkdir tesdosyası"
- "dotnet pack GitlabCITest.csproj"
- "ls -al /builds/test/gitlabcitest/GitlabCITest/bin/Debug"
- "dotnet nuget push --force-english-output /builds/test/gitlabcitest/GitlabCITest/bin/Debug/*.nupkg -s MyCustomNugetServerAddress -k MyApiKey"
When it runs i am getting 403 forbidden error on push jobs.
The error log:
$ ls -al /builds/test/gitlabcitest/GitlabCITest/bin/Debug
total 32
drwxr-xr-x. 3 root root 4096 Oct 11 06:57 .
drwxr-xr-x. 3 root root 4096 Oct 11 06:57 ..
-rw-r--r--. 1 root root 3929 Oct 11 06:57 GitlabCITest.1.0.0.nupkg
drwxr-xr-x. 2 root root 4096 Oct 11 06:57 netcoreapp2.1
$ dotnet nuget push --force-english-output /builds/test/gitlabcitest/GitlabCITest/bin/Debug/*.nupkg -s MyCustomNugetServerAddress -k MyApiKey
info : Pushing GitlabCITest.1.0.0.nupkg to 'MyCustomNugetServerAddress'...
info : PUT MyCustomNugetServerAddress
info : Forbidden MyCustomNugetServerAddress 651ms
error: Response status code does not indicate success: 403 (Forbidden).
It was all about password characters, i have a ';' in my apikey so it made a complication. just add ' character beginning and the end of your apikey if you have special characters in your apikey. 'apikey'

Errno::EACCES: Permission denied # rb_sysopen when using systemd to start sharetribe service

I am new to sharetribe and dont have any experience with ruby etc. I followed the steps to setup sharetribe from here:
https://freedif.org/how-to-install-sharetribe-for-ubuntu-16-04/
When i start the services manually I do not see such issues. I see the below errors when i connect to the terminal again and check the status using 'journalctl -u sharetribe.service'.
I checked the permissions for the path and the files, i did chmod 777 so that all users have permissions. Any thoughts?
Feb 19 03:07:16 ubuntu-xenial-1 sharetri[4628]: W, [2018-02-19T03:07:16.099853 #4775] WARN -- : Failed creating logger for file /home/arvind_nm/sharetribe/sharetribe/lo
Feb 19 03:07:16 ubuntu-xenial-1 sharetri[4628]: W, [2018-02-19T03:07:16.102594 #4775] WARN -- : Errno::EACCES: Permission denied # rb_sysopen - /home/arvind_nm/sharetribe/sharetribe/log/newrelic_agent.log
Feb 19 03:07:16 ubuntu-xenial-1 sharetri[4628]: D, [2018-02-19T03:07:16.102956 #4775] DEBUG -- : Debugging backtrace:
Feb 19 03:07:16 ubuntu-xenial-1 sharetri[4628]: D, [2018-02-19T03:07:16.102956 #4775] DEBUG -- : Debugging backtrace:

Getting deployment error when deploying sample script in Developer composer playground

I'm trying to setup the development environment for composer by following the steps in the tutorial. I was able to generate the .bna file successfully and use it in the online playground. But when I try to deploy the .bna file to the fabric V1.0 running in my local, I get the below error.
ubuntu#ip-172-31-8-83:~/fabric-tools/my-network$ cd dist
ubuntu#ip-172-31-8-83:~/fabric-tools/my-network/dist$ composer network
deploy -a my-network.bna -p hlfv1 -i PeerAdmin -s randomString
Deploying business network from archive: my-network.bna
Business network definition:
Identifier: my-network#0.0.1
Description: The Hello World of Hyperledger Composer samples
events.js:160
throw er; // Unhandled 'error' event
^
Error: event message must be properly signed by an identity from the same organization as the peer: [failed deserializing event creator: [Expected MSP ID Org1MSP, received ]]
at ClientDuplexStream._emitStatusIfDone (/home/ubuntu/.nvm/versions/node/v6.11.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:189:19)
at ClientDuplexStream._receiveStatus (/home/ubuntu/.nvm/versions/node/v6.11.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:169:8)
at /home/ubuntu/.nvm/versions/node/v6.11.0/lib/node_modules/composer-cli/node_modules/grpc/src/node/src/client.js:634:14
My docker images are as follows:
ubuntu#ip-172-31-8-83:~/fabric-tools/my-network/dist$ docker ps -a
CONTAINER ID IMAGE COMMAND
CREATED STATUS PORTS
NAMES
80c9949edf73 hyperledger/fabric-peer:x86_64-1.0.0-beta "peer
node start -..." 19 minutes ago Up 19 minutes 0.0.0.0:7051-
>7051/tcp, 0.0.0.0:7053->7053/tcp peer0.org1.example.com
126f6381cc90 hyperledger/fabric-couchdb:x86_64-1.0.0-beta "tini --
/docker-e..." 19 minutes ago Up 19 minutes 4369/tcp, 9100/tcp,
0.0.0.0:5984->5984/tcp couchdb
924081546fa1 hyperledger/fabric-ca:x86_64-1.0.0-beta "sh -c
'fabric-ca-..." 19 minutes ago Up 19 minutes 0.0.0.0:7054-
>7054/tcp ca.example.com
d13f2c8e8421 hyperledger/fabric-orderer:x86_64-1.0.0-beta "orderer"
19 minutes ago Up 19 minutes 0.0.0.0:7050->7050/tcp
orderer.example.com
Node version is: 4.2.6
npm version is : 3.5.2
Docker version 17.06.0-ce, build 02c1d87
Can someone tell me how to resolve this?
you need to be at the latest Node level - you're currently at 4.2.6 - you need to be at node version 6.x
https://hyperledger.github.io/composer/unstable/installing/development-tools.html
I assume you're using Ubuntu 14.04 or 16.0x LTS ..

PHP script execution won't start at break point

I'm running PHP 5.5.9 on Ubuntu 4.19, Vagrant, Virtual box on Mac. I'm trying to use debugger on PhpStorm (2016.2.1) , so I followed couple of tutorials how to do that, enabled XDebug 2.2.3. My current status is:
When checked from PhpStorm (Run -> Web Server Debug Validation) everything is ok, no errors.
On Google Chrome I've installed "Jet Brains IDE support" plugin
On PhpStorm when I click on "Start listening for PHP debug connections" it turns green - everything fine here too, I guess.
PhpStorm, when I click "Debug" icon, Chrome starts well, opens page I'm trying to debug and I get balloon tip from Chrome: "JetBrains IDE Support" is debugging this browser and small bug icon turns green ("debug" mode).
So apparently everything is ok, but script execution just won't stop at my break point. Any idea what I'm missing here. Here is my php.ini settings regarding xdebug:
Directive Local Value Master Value
xdebug.auto_trace Off Off
xdebug.cli_color 0 0
xdebug.collect_assignments Off Off
xdebug.collect_includes On On
xdebug.collect_params 0 0
xdebug.collect_return Off Off
xdebug.collect_vars Off Off
xdebug.coverage_enable On On
xdebug.default_enable On On
xdebug.dump.COOKIE no value no value
xdebug.dump.ENV no value no value
xdebug.dump.FILES no value no value
xdebug.dump.GET no value no value
xdebug.dump.POST no value no value
xdebug.dump.REQUEST no value no value
xdebug.dump.SERVER no value no value
xdebug.dump.SESSION no value no value
xdebug.dump_globals On On
xdebug.dump_once On On
xdebug.dump_undefined Off Off
xdebug.extended_info On On
xdebug.file_link_format no value no value
xdebug.idekey PHPSTORM PHPSTORM
xdebug.max_nesting_level 100 100
xdebug.overload_var_dump On On
xdebug.profiler_aggregate Off Off
xdebug.profiler_append Off Off
xdebug.profiler_enable Off Off
xdebug.profiler_enable_trigger Off Off
xdebug.profiler_output_dir /tmp /tmp
xdebug.profiler_output_name cachegrind.out.%p cachegrind.out.%p
xdebug.remote_autostart Off Off
xdebug.remote_connect_back Off Off
xdebug.remote_cookie_expire_time 3600 3600
xdebug.remote_enable On On
xdebug.remote_handler dbgp dbgp
xdebug.remote_host 192.168.33.22 192.168.33.22
xdebug.remote_log no value no value
xdebug.remote_mode req req
xdebug.remote_port 9000 9000
xdebug.scream Off Off
xdebug.show_exception_trace Off Off
xdebug.show_local_vars Off Off
xdebug.show_mem_delta Off Off
xdebug.trace_enable_trigger Off Off
xdebug.trace_format 0 0
xdebug.trace_options 0 0
xdebug.trace_output_dir /tmp /tmp
xdebug.trace_output_name trace.%c trace.%c
xdebug.var_display_max_children 128 128
xdebug.var_display_max_data 512 512
xdebug.var_display_max_depth 3 3
Update 1
On #LazyOne suggestion I checked on php error log and there was an error:
PHP: syntax error, unexpected '=' in /etc/php5/apache2/php.ini on line 1935
Failed loading /usr/lib/php5/20100525/xdebug.so: /usr/lib/php5/20100525/xdebug.so: cannot open shared object file: No such file or directory
I checked for missing xdebug.so file and it's parent dir was wrong. On my machine it was "20121212", so I changed that, restarted apache and after I'm getting following content in error log:
[Fri Aug 26 12:15:55.407344 2016] [mpm_prefork:notice] [pid 22840] AH00169: caught SIGTERM, shutting down
PHP Warning: Module 'xdebug' already loaded in Unknown on line 0
[Fri Aug 26 12:15:56.415611 2016] [mpm_prefork:notice] [pid 22903] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.19 configured -- resuming normal operations
[Fri Aug 26 12:15:56.415660 2016] [core:notice] [pid 22903] AH00094: Command line: '/usr/sbin/apache2'
That's all there is in php error file. #LazyOne, is that the error log file you were talking about or there is some other?
Update 2
I added following configuration to my php.ini file:
[xdebug]
zend_extension = /usr/lib/php5/20121212/xdebug.so
xdebug.remote_enable = 1
xdebug.remote_host = 192.168.33.22
xdebug.remote_port = 9000
xdebug.idekey = PHPSTORM
Update 3
xdebug log follows:
Log opened at 2016-08-26 13:55:30
I: Connecting to configured address/port: 192.168.33.22:9000.
E: Could not connect to client. :-(
Log closed at 2016-08-26 13:55:30

Resources