Incompatibility between server and localhost charset - spring

I'm currently developing a Spring Boot App with MariaDB as a Database. My localhost is a Windows 10 installation and the production server is a AWS Linux (first gen) image.
On localhost I have a local MariaDB installation.
On production I have a AWS RDS instance running MariaDB, default parameters.
Currently the problem I facing is the following, I'm trying to save the following characters ["↑", "↓", "→", "←"] to DB. On localhost characters are save as excepted. On the production server characters are saved as "?". Both DB's have the same mysqldump file.
I already debugged both Spring instances and they both receive parameters as intended.
Any ideas?
Extra 1:
The only big difference between both instance is that localhost runs with the ./mvnw command while the production site is a generated jar running inside a Docker container.

In utf8 (or utf8mb4), those characters are hex E28691 E28693 E28692 E28690
See "question mark" in Trouble with UTF-8 characters; what I see is not what I stored for an explanation of the step you failed to do.
In addition, check for ?useUnicode=yes&characterEncoding=UTF-8 in the getConnection() call.

Related

Hasura connecting to graphql-engine server failed

I'm migrating hasura from v1.1 (with config v1) to v2.10 (with config v3).
Locally, I had no issue. I followed this guide
When deploying to test, I can't make it work.
I'm using the hasura/graphql-engine.v2.9.10.cli-migrations-v3 image. I recreated my database to process from scratch.
I have the following error :
Test and local env are different on the following points :
host and ip: (localhost:8080 on local VS classic DNS with 80 port for test env) but I used the HASURA_GRAPHQL_ENDPOINT to override the url with my DNS (for instance HASURA_GRAPHQL_ENDPOINT=https://my-custom-url.com)
In local, my db is "default" but its "ebeton-recette" in test env. But my metadata/databases/databases.yaml use
When using the hasura/graphql-engine.v2.9.10 image (without the suffix) it works and I can apply metadata/migrations using --endpoint and --admin-secret flags. But I really want the migrations and metadata to be auto applied when deploying...
The "3) Server might me unhealthy..." is indeed true because it fails instantly on deploy...

Cannot forward ports when running Linux container on Windows10 as a host

I'm new using Docker. I have been trying to deploy a Linux container (with Windows as a host) with a Google Cloud image inside using Docker. I'm able to do everything well, at the end the server is running perfectly, but when I want to check the server, using the localhost in the browser, I got a blank page with:
Blank page
This is the Dockerfile:
FROM google/cloud-sdk
ENV PATH /usr/lib/google-cloud-sdk/bin:$PATH
WORKDIR docker_folder
COPY local_folder/ .
RUN pwd
EXPOSE 8080
CMD ["java_dev_appserver.sh", "."]
This is the command I'm using to build my image (in the CMD):
docker build --tag serverdeploy .
This is the command I'm using to run my container
docker run -p 8080:8080 serverdeploy
This is the stack trace that I got when I run the server
where I know that I running the server
I did some research and looks like Docker had a problem with the ports when you use a Linux container in Windows (Not sure if it's already solved or not). I've already tried all the possible solutions that I found out there (even trying to replace 'localhost' by all the ip's that I get when I run ipconfig on the cmd) but I still get the same error.
And, as last hope, I need your help to understand what I'm doing wrong, or if I missing something
You are running your service bind to localhost - that means no remote connections are accepted (as well as binding to 127.0.0.1. And for your container the host is a remote connection.
Change binding to 0.0.0.0 (which I guess is default) and enjoy.
Btw sharing your java_dev_appserver.sh would be helpful for answering the question.

postgres bad connection localhost

On UBUNTU, I have a ruby app with a postgresql database on my localhost.
Everything was working fine yesterday, but today my database was gone. I was still able to open the app. Then I got an error saying something like,
run rails db:migrate
After I ran the command I started getting
PG::ConnectionBad at /
server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.
None of the config files were changed since yesterday.
I use docker-compose up to start the server and apparently it starts the connection but I still cannot access my localhost.
What could be the problem here?
Thank you in advance
Check the logs in your DB, if the DB is running on docker as well then maybe it's not finishing the DB boot correctly.
If this is the case, run the DB container manually first with the same options as in your docker-compose and then check docker logs for that container.

Docker container from docker cloud on windows

I've some repositories on docker cloud. I build and deploy it on my home ubuntu server and that work well.
On my home server, I can access these services with their url (like http://registry:8761).
I'm trying to run my service on Kitematic on Windows, all of my services are running on localhost, so my configuration in application.yml where I say that my registry service is on http://registry:8761 doesn't work.
Could someone help me ?
Thanks
Your browser doesn't know what to do with http://registry since it's got no TLD qualifier. I assume your ubuntu server is set up in a way to do all the correct redirections, but with Windows you'd have to add an entry in your hosts file that points http://registry to localhost or wherever it's supposed to go

Cannot access sinatra app on AWS Windows from remote machine

I have a simple sinatra app running on an AWS windows instance. Running the application from the localhost works fine (i.e. http://localhost:4567), but I am unable to run it remotely.
My AWS windows instance is available to me from remote as I am able to connect to it using RDP.
After reading some other similar issues, I have already applied the following:
My AWS security group is opened for port 4567 (I actually also opened it for any inbound connection just to see if that will solve the issue - it didn't)
I tried running: ruby my_sinatra_app.rb -o 0.0.0.0
I tried running: ruby my_sinatra_app.rb -e production
I tried adding to the application itself the following code: set :bind, '0.0.0.0'
I am still unable to run the application remotely. Any idea?
I was able to solve my issue, so for the sake of completeness I am publishing the answer.
This wasn't a Sinatra issue, but an AWS issue (maybe not really an issue, more like my misunderstanding). I was under the impression that updating the AWS security group for opening the 4567 port will do the trick.
However, it turns out that I needed also to open the port on the Windows Firewall on my Windows AWS instance. After opening the port on the Windows Firewall I was able to remotely connect to my Sinatra app.

Resources