Rails and active_storage: Cannot load `Rails.config.active_storage.service`: (RuntimeError) Missing service adapter for "S3" - rails-activestorage

I see this error in my console when all the configuration is right
Cannot load `Rails.config.active_storage.service`: (RuntimeError) Missing service adapter for "S3"

It is not clear in the documentation, I have to add the gem aws-sdk-s3 to my Gemfile
gem "aws-sdk-s3", require: false

Related

Terraform Cloud in Git mode - failed to read schema, permission denied

I'm new to terraform and trying to use a 'custom' provider with Terraform cloud. To be clear, if I use it on my Windows machine without the TCloud everything works just fine.
On the TCloud I've got a workbook synchronized to my Git repo. The custom provider is uploaded to the Git repo: \terraform.d\plugins\zscaler.com\zpa\zpa\2.0.5\linux_amd64\terraform-provider-zpa_v2.0.5.
I've ran the chmod command to compensate for Window's lack of ability to set the provider as executable:
git update-index --chmod=+x .\terraform.d\plugins\zscaler.com\zpa\zpa\2.0.5\linux_amd64\terraform-provider-zpa_v2.0.5
I've also updated the lock file to allow both windows and linux provider hashes to deal with "local provider doesn't match any of the checksums" issue:
terraform providers lock -fs-mirror="C:\Users\user1\AppData\Roaming\terraform.d\plugins\" -platform=windows_amd64 -platform=linux_amd64 zscaler.com/zpa/zpa
When I run terraform plan from VSCode (on my Windows machine) on the repo that's initialized to the TCloud I get the following error:
> terraform plan -var-file terraform.tfvar
. . .
2022-02-02T10:14:28.328-0600 [INFO] cloud: starting Plan operation
Terraform v1.1.4
on linux_amd64
Configuring remote state backend...
Initializing Terraform configuration...
╷
│ Error: failed to read schema for zpa_provisioning_key.iot_edge_key in zscaler.com/zpa/zpa: failed to instantiate provider "zscaler.com/zpa/zpa" to obtain schema: fork/exec .terraform/providers/zscaler.com/zpa/zpa/2.0.5/linux_amd64/terraform-provider-zpa_v2.0.5: permission denied
Enabling debug doesn't give me any more clue on what's wrong. Appreciate any suggestions.
Thank you

RoR App: “The asset 'application.css' is not present in the asset pipeline”

Info:
Rails 6.1.4
Ruby 3.0.1
PostgreSQL 9.6
NodeJS 11.15.0
Yarn 1.22.5
when I start my APP I always got the same error:
I've tried all I saw in others posts but I can´t resolve this problem.
Any suggestions?
In config/environments/production.rb I added the following line:
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = true
also I checked the following line:
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present?
With this configuration I can start my APP.
Did you tried to do the following on the server
RAILS_ENV=production bundle exec rake assets:precompile

Tutorial fails for AWS Node.js

I am currently working through AWS's Node.js tutorial, but am stymied at the deployment phase. When I try to upload the provided source bundle, the build fails and I get the following error:
Unable to deploy application version: Configuration validation exception: Invalid option specification (Namespace: 'aws:elasticbeanstalk:container:nodejs:staticfiles', OptionName: '/static'): Unknown configuration setting.
Where does this error come from, and where can I look to fix it?
"The current configuration assumes that you are using Amazon Linux AMI (pre-Amazon Linux 2), but the current default image is "Amazon Linux 2" and the static file parameter has changed."
Solution:
edit .ebextensions/options.config file
change:
aws:elasticbeanstalk:container:nodejs:staticfiles:
to
aws:elasticbeanstalk:environment:proxy:staticfiles:
reference: https://github.com/aws-samples/eb-node-express-sample/pull/21/files

ERROR: This branch does not have a default environment issue?

I am attempting to launch a NodeJS app on AWS direct link to guide here:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/create_deploy_nodejs_express.html
Screen capture:
When running the git commit -m "First express app" command I always get this error (everything else works fine up until that point)
ERROR: This branch does not have a default environment. You must
either specify an environment by typing "eb deploy my-env-name" or set
a default environment by typing "eb use my-env-name".
If you have overcome a similar experience or can shed light it is more welcome.
Here is my solution
I had the environment in my config but had to call it
inside .ebextensions/config.yml is the following:
branch-defaults:
default:
environment: node-express-env
group_suffix: null
global:
application_name: my_app_name
branch: null
default_ec2_keyname: null
default_platform: node.js
default_region: us-east-2
include_git_submodules: true
instance_profile: null
platform_name: null
platform_version: null
profile: eb-cli
repository: null
sc: git
workspace_type: Application
As such when I modified my command from
eb deploy
to
eb deploy node-express-env
it worked.
There is more information on the AWS docs:
https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb-cli-troubleshooting.html
Solution: Run eb list to see a list of available environments. Then run eb use env-name to use one of the available environments.

Running jhipster-registry in native profile: central-config folder not rode

I am currently trying to run jhipster-registry in dev profile to serve the configurations to a jhipster microservice application.
I've followed this official jhipster registry doc and:
have built it from sources, and launched it as follow:
./jhipster-registry-3.0.0.war --spring.profiles.active=dev
And as the doc states, i have put the central-config directory containing <mymicrosericeappname>-dev.yml alongside the jhipster-registry generated war file.
When i launch jhipster-registry, everything is ok,
but when i run my microservice application, it connects to the registry (i can see it in the jhipster-registry dashboard), but i realize that it is reading the application-dev.yml file located at src/main/resources/config/ inside the microservice app.
I dont know if i misplaced the central-config folder...
That said, i really need to know what's wrong.
Thanks
The config directory is specified in bootstrap.yml in search-locations property.
spring:
cloud:
config:
server:
native:
search-locations: file:./central-config
Rather than specifying a relative path (relative to where you launched the regsitry from), you may want to specify an absolute path:
search-locations: file:/home/something/central-config
Also rather than using dev profile, you can use prod with native :
./jhipster-registry-3.0.0.war --spring.profiles.active=prod,native
Thanks to #GaelMarziou, his answer helped me found why the central-config was not being rode.
In fact the Spring Cloud Config bootstrap configuration for the "dev" profile bootstrap.yml file gives this:
cloud:
config:
server:
git:
uri: https://github.com/jhipster/jhipster-registry-sample-config
native:
search-locations: file:./central-config
So each time i ran jhipster-registry, it was pointing the git repo and not the central-config directory.
To get it work, i had to launch the registry in dev,native profile :
./jhipster-registry-3.0.0.war --spring.profiles.active=dev,native
Nevertheless the documentation states this:
Using the dev profile will run the JHipster Registry with the dev and the native profiles.
Which is not really true... considering my struggling.

Resources