By using AWS re:Post, you agree to the Terms of Use
/Amazon Lightsail/

Questions tagged with Amazon Lightsail

Sort by most recent
  • 1
  • 90 / page

Browse through the questions and answers listed below or filter and sort to narrow down your results.

Lightsale instances cannot connect to Lightsail database

I have a web app running on Lightsail instances stacked with LAMP (PHP 7/MariaDB 10 service). When I want to connect the instances to a Lightsail database instead of localhost, it works sporadically. The front end reads "cannot connect to MySQL database" and in the database server log I read : `[MY-010055] [Server] IP address 'xxx.xxx.xxx.xxx' could not be resolved: Name or service not known" where the IP is the private IP address of my instance.` My instances and database are in the same region. Even though it is not necessary I have tried enabling VPC peering and opening the db to the public. **I can connect to the database using the command line tool**: mysql -u uuuu -p -h hhhhh (ie: it is not a problem with entering the wrong credentials) **The web app seems to work with the dedicated Lightsail db server when I am the only one using it** and until I open it to more traffic, then I get the connection error. I have increased the number of max_connections from 65 to 500 using the aws CLI (localhost is 150). My current traffic is 2000 visitors per day. ``` aws lightsail update-relational-database-parameters --relational-database-name Database-1 --parameters "parameterName=max_connections,parameterValue=150,applyMethod=immediate" ``` Localhost is Mariadb 10, dedicated database server is MySQL 8 SSL is handled by Cloudflare. There's no SSL on my instance. I don't want to keep using localhost dbs, I want to centralize my data in a dedicated database. Does anyone know how to handle this problem?
0
answers
0
votes
4
views
jeffbond
asked 11 days ago

Lightsail containers keep failing with no output

Hi, This is the first time I try to use AWS Lightsail. I use it in `us-east-1`. I setup a nano single instance and try to run two containers - one with a Go program which talks to a database and one with Nginx front-end serving a React application. For the sake of troubleshooting, I narrowed it down to just the Go program. The Docker image I created on my laptop runs fine on my laptop, it can even open the connection to the database (I made the database public while debugging). But when I push the image to Lightsail and try to deploy it, all I get is: ``` [1/Jan/2022:01:03:21] [deployment:8] Creating your deployment [1/Jan/2022:01:04:31] [deployment:8] Started 1 new node [1/Jan/2022:01:05:25] [deployment:8] Started 1 new node [1/Jan/2022:01:06:34] [deployment:8] Started 1 new node [1/Jan/2022:01:07:12] [deployment:8] Canceled ``` No matter what I try. The container's ENTRYPOINT script prints some output (for instance, it executes `env` to show the environment), but I don't see it in the logs and the Go code is verbose when it starts up but I don't see the expected output in the logs either. It also starts in about 5 seconds, including opening the connection to the database and running a few quick transactions on it, so I don't think it's a matter of slow start. I couldn't find any other output or logs from Lightsail. The container takes about 3Mb of RAM when it runs on my laptop, way less than the 512Mb available on the Nano instance. Similar issues happen with the container which runs Nginx. It's a custom container based on the official `nginx:alpine` image with my static files and extra config added to it. It runs fine on my laptop. What am I doing wrong? Where else can I look for hints on why my deployments fail? I've been banging my head over this for three days now.
0
answers
0
votes
8
views
AWS-User-2683653
asked 16 days ago

How to debug CLI crash when running Lightsail container commands?

I only use a couple of commands in my workflow but very often both will randomly throw a cryptic error in the middle of a deploy on CI: - `aws lightsail get-container-service-deployments --region us-west-2 --service-name my_service --output json` - `aws lightsail get-container-images --region us-west-2 --output json --service-name my_service` My CI stack is Ubuntu Server 18.04 which runs a Github action-runner service. ``` Signal received: -1695824320, errno: 32575 Stack trace: /usr/local/aws-cli/v2/2.3.0/dist/_awscrt.cpython-38-x86_64-linux-gnu.so(aws_backtrace_print+0x4d) [0x7f3f9483edbd] /usr/local/aws-cli/v2/2.3.0/dist/_awscrt.cpython-38-x86_64-linux-gnu.so(+0x68513) [0x7f3f947b5513] /lib/x86_64-linux-gnu/libc.so.6(+0x3f040) [0x7f3f9af46040] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(+0x1f9ed0) [0x7f3f9ab65ed0] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(+0xbb58b) [0x7f3f9aa2758b] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(+0x1fa930) [0x7f3f9ab66930] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(PyGC_Collect+0x81) [0x7f3f9ab67aa1] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(Py_FinalizeEx+0xe2) [0x7f3f9ab3ff02] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(Py_Exit+0x8) [0x7f3f9ab40818] /usr/local/aws-cli/v2/2.3.0/dist/libpython3.8.so.1.0(+0x1d8c8b) [0x7f3f9ab44c8b] aws(+0x378b) [0x55705f60f78b] aws(+0x3b1f) [0x55705f60fb1f] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xe7) [0x7f3f9af28bf7] aws(+0x24fa) [0x55705f60e4fa] ``` Any ideas what to do about this? **edit Jan 1, 2022** I turned on the `--debug` flag. **There is no debug output**. The command seems to immediately crash. I find if I run these command multiple times, they randomly crash with and sometimes it prints "Segmentation fault" which looks to likely to be a memory access/management issue :( Something else worth saying is this issue only presents itself on Ubuntu distros. I ran out of options to try and reinstalled other OS like ArchLinux and did not experience the same problem. Unfortunately some of the other software I use isn not well supported under ArchLinux and I have to come back to Ubuntu :(
2
answers
0
votes
4
views
AWS-User-Arman
asked 16 days ago

Multiple starts + bad timing w/ db container?

I have a deployment with a private php:7.4-apache derivative image container and a database container. When I launch my deployment, it is failing, but I don't know why. For some reason, it appears to start multiple times: ``` [28/Dec/2021:16:16:15] [deployment:33] Creating your deployment [28/Dec/2021:16:17:05] > Wrote the baseURL ([REDACTED].us-east-1.cs.amazonlightsail.com) to .env [28/Dec/2021:16:17:05] [File\Write] Writing to /var/www/fairs/.env. [28/Dec/2021:16:18:11] [deployment:33] Started 1 new node [28/Dec/2021:16:19:18] [File\Write] Writing to /var/www/fairs/.env. [28/Dec/2021:16:19:18] > Wrote the baseURL ([REDACTED].us-east-1.cs.amazonlightsail.com) to .env [28/Dec/2021:16:20:21] [deployment:33] Started 1 new node [28/Dec/2021:16:20:49] [deployment:33] Took too long ``` I also have a mysql import in my launch command that fails whenever I try to import a database snapshot: ``` [28/Dec/2021:19:23:00] ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) ``` But when I look at the logs of my db container, it doesn't appear to be ready at that exact time.: ``` [28/Dec/2021:19:22:07] [deployment:35] Creating your deployment [28/Dec/2021:19:22:59] 2021-12-28 19:22:59+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started. [28/Dec/2021:19:22:59] 2021-12-28 19:22:59+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' [28/Dec/2021:19:23:00] 2021-12-28 19:22:59+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 5.7.33-1debian10 started. [28/Dec/2021:19:23:00] 2021-12-28 19:23:00+00:00 [Note] [Entrypoint]: Initializing database files [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.385802Z 0 [Warning] Changed limits: max_open_files: 1024 (requested 5000) [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.385858Z 0 [Warning] Changed limits: table_open_cache: 431 (requested 2000) [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.385992Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details). [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.791276Z 0 [Warning] InnoDB: New log files created, LSN=45790 [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.843479Z 0 [Warning] InnoDB: Creating foreign key constraint system tables. [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.904067Z 0 [Warning] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 9240f4d4-6813-11ec-af07-0a58a9feac02. [28/Dec/2021:19:23:00] 2021-12-28T19:23:00.906067Z 0 [Warning] Gtid table is not ready to be used. Table 'mysql.gtid_executed' cannot be opened. [28/Dec/2021:19:23:02] 2021-12-28T19:23:02.285861Z 0 [Warning] CA certificate ca.pem is self signed. ... [28/Dec/2021:19:23:06] 2021-12-28T19:23:06.403308Z 0 [Note] mysqld: ready for connections. [28/Dec/2021:19:23:06] Version: '5.7.33' socket: '/var/run/mysqld/mysqld.sock' port: 0 MySQL Community Server (GPL) ``` When I take out the launch command in my container, it launches fine. Is the command supposed to return something to indicate that it's done and ok? I need the launch command to configure my app and import the database.
0
answers
0
votes
9
views
Purdy
asked 19 days ago

Communication Between Lightsail Containers

I want to deploy two containers which is "nginx" and "php-fpm(Laravel)". I already create and make it work on local using docker-compose. But by Lightsail it failed. Lightsail logs said php-fpm container not found which I set the name on container.yml. `nginx: [emerg] host not found in upstream "php" in /etc/nginx/conf.d/default.conf:24` The line 24 is`fastcgi_pass php:9000;`, indicating the name of php container not found. Like docker-compose, I thought it would be possible with specifying container name can communicate between each containers. So, my question is what is the right way to configure for communicate between two container. Here is the settings. nginx default.conf ``` server { listen 80 default_server; listen [::]:80 default_server; server_name _; root /app/public; add_header X-Frame-Options "SAMEORIGIN"; add_header X-XSS-Protection "1; mode=block"; add_header X-Content-Type-Options "nosniff"; index index.html index.htm index.php; charset utf-8; location / { try_files $uri $uri/ /index.php?$args; } location ~ \.php$ { try_files $uri =404; fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_path_info; include fastcgi_params; fastcgi_buffer_size 32k; fastcgi_buffers 4 32k; fastcgi_read_timeout 1200s; fastcgi_send_timeout 1200s; } } ``` Lightsail container.yml ``` serviceName: ${SERVICE_NAME} containers: nginx: command: [] image: ${LATEST_NGINX_LIGHTSAIL_DOCKER_IMAGE} ports: '80': HTTP php: command: [] image: ${LATEST_PHP_LIGHTSAIL_DOCKER_IMAGE} publicEndpoint: containerName: nginx containerPort: 80 healthCheck: healthyThreshold: 2 intervalSeconds: 20 path: /api/healthcheck successCodes: 200-499 timeoutSeconds: 4 unhealthyThreshold: 2 ```
1
answers
0
votes
12
views
AWS-User-3125427
asked 19 days ago

Something went wrong with DNS. www.test.com DNS shows but not for test.com

``` A record Associate your domain or a subdomain with an IPv4 address. Subdomain * .test.com Resolves to StaticIp-2 MX record Direct mail services to a mail server. Subdomain * .test.com Priority 10 Maps to mail.test.com TXT record Respond with text when your domain is queried. Subdomain * .test.com Responds with v=spf1 +mx +a ?all TXT record Respond with text when your domain is queried. Subdomain _acme-challenge .test.com Responds with mvlw84gfZwHZlq36mk70TqjbUyy8S7QlSsMsa-kZlic TXT record Respond with text when your domain is queried. Subdomain _dmarc .test.com Responds with v=DMARC1;p=none;sp=none;adkim=r;aspf=r;rua=mailto:alex@test.com;fo=1 TXT record Respond with text when your domain is queried. Subdomain _domainconnect .test.com Responds with v=DKIM1;t=s;p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCoA2W4ouCnBDweX03LlbLLgtrDhrHkUczRaoUS26TnsgSlvIm5xVeQzN5SMWVBcWIdCsaEbRax5t8NgAHmP9XYsfKSbVC6nHk2e/eLWkD5rIqdaBITD/K733Mn6mGth0paz5p+/c98Xq27o/uD/4vxV9DqxQMEWPVrYX6BNdCaWwIDAQAB A record Associate your domain or a subdomain with an IPv4 address. Subdomain @ .test.com Resolves to StaticIp-2 ``` PlesK DNS entries ```` www.test.com. CNAME test.com. webmail.test.com. A 51.133.245.221 test.com. MX (10) mail.test.com. _dmarc.test.com. TXT v=DMARC1; p=none test.com. A 51.133.245.221 test.com. NS ns1.test.com. mail.test.com. A 51.133.245.221 ipv4.test.com. A 51.133.245.221 ns1.test.com. A 51.133.245.221 ns2.test.com. A 51.133.245.221 mindfuleducators.test.com. A 172.22.7.164 ftp.test.com. CNAME test.com. _domainconnect.test.com. TXT domainconnect.plesk.com/host/intelligent-mahavira.51.133.245.221.plesk.page/port/8443 test.com. TXT v=spf1 +a +mx +a:intelligent-mahavira.51.133.245.221.plesk.page -all 51.133.245.221 / 16 PTR mail.test.com. 51.133.245.221 / 16 PTR test.com. _smtps._tcp.test.com. SRV test.com. _pop3s._tcp.test.com. SRV test.com. _imaps._tcp.test.com. SRV test.com. test.com. NS ns2.test.com. ```` It was all working. I was working in postfix filter local domain emails. i might have messed up something when i reset dns settings in plesk. Now i cant recollect. I over wrote my snapshot. So i have to figure this one out manually Mclookup.com www.test.com - it finds all good test.com - no dns Not a real ip or domain entered here. So mails dont come from outside and fail on searching dns on test.com
1
answers
-1
votes
5
views
alexk
asked 20 days ago

Cant send or recieve email from Ubuntu (plesk) lightsail instance. Who can help?

ll my emails stuck in mailqueue if i send it. Also i send emails from gmail it got bounced. Whats going on? how to solve it? I am stuck. I asked aws to unblock ports, they say its unblocked Help!!Pls. Dec 20 11:21:19 eager-lichterman postfix/smtp[40605]: : to=<gmail.com>, relay=none, delay=150, delays=0.21/0.01> Dec 20 11:22:09 eager-lichterman postfix/anvil[40592]: statistics: max connection rate 1/60s for (smtp:::1) at Dec 20 11:18:49 Dec 20 11:22:09 eager-lichterman postfix/anvil[40592]: statistics: max connection count 1 for (smtp:::1) at Dec 20 11:18:49 Dec 20 11:22:09 eager-lichterman postfix/anvil[40592]: statistics: max cache size 1 at Dec 20 11:18:49 Dec 20 11:27:15 eager-lichterman postfix/qmgr[3597]: : from=<@mydomain>, size=812, > Dec 20 11:27:45 eager-lichterman postfix/smtp[43163]: connect to gmail-smtp-in.l.google.com[173.194.175.27]:25: Connection timed out Dec 20 11:28:15 eager-lichterman postfix/smtp[43163]: connect to gmail-smtp-in.l.google.com[2607:f8b0:400d:c00::1b]:25: Connection > Dec 20 11:28:45 eager-lichterman postfix/smtp[43163]: connect to alt1.gmail-smtp-in.l.google.com[64.233.186.26]:25: Connection time> Dec 20 11:29:15 eager-lichterman postfix/smtp[43163]: connect to alt1.gmail-smtp-in.l.google.com[2800:3f0:4003:c00::1a]:25: Connect> Dec 20 11:29:45 eager-lichterman postfix/smtp[43163]: connect to alt2.gmail-smtp-in.l.google.com[209.85.202.26]:25: Connection time> Dec 20 11:29:45 eager-lichterman postfix/smtp[43163]: : to=<@gmail.com>, relay=none, delay=656, delays=506/0.01/> Firewall ======= All incoming is allowed. added ports in instances page 21-25 , 465 , 587
4
answers
0
votes
7
views
alexk
asked a month ago

AWS Abuse Report - Never got one of these before

We have been using an LS instance (preconfigured Ubuntu 20.04lts VM) running PLESK and a wordpress site for our church. Has been up for about a month. Today, I got an email from AWS about an abuse. The report shows that the IP6 was doing automated crawling: ******* * Log Extract: <<< ****We are seeing automated scraping of Google Web Search from a large number of your IPs/VMs. ********** There's nothing in the data of the report except this: **+----------------------------------------+--------------------------+----------+---------------------+ | Source | Time_UTC | Destination | DestPort | +----------------------------------------+--------------------------+----------+---------------------+ 2600:1f18:6502:5000:a087:4d0e:325:9709 2021-12-13 22:17:01 2607:f8b0:4004:808::2004 443** The prebuilt VM (an ubuntu 20.04 LTS preconfigured with Wordpress/plesk) had IP6 enabled by default. So I need some help as this is not my area of expertise. When I run NETSTAT -AN, I see no established connections over that IP6 address. Since we don't use IP6, I have disabled it. But there was no established IP6 connections to any endpoint, let alone the one noted specifically above). Still, I'm concerned my system is compromised. I don't really know what to do. I had the Network config and the WAF limiting access, bu somehow the system looks to have been compromised. How do I root out whether there's a breach, an already in place virus or malware or rootkit? How do I scan my system for threats?
2
answers
0
votes
14
views
RWITDIRECTOR
asked a month ago

Root User for Linux

I am not very fluent in using Linux at the command line. With that in mind, I set up Plesk on my Lightsail instance, and it is working great. What I am trying to do is migrate some websites from a colleague's AWS Lightsail instance which is also running Plesk. I have used this migration tool before, and it works very well once you get the servers authenticated and a connection established. Unfortunately, to do this, I have the option of providing the root user and password for the source server, or I can use SSH keys as credentials. We tried a few different combinations of credentials he uses to sign in to his AWS account, and to sign in to his Plesk dashboard, but nothing will work. I do not have enough familiarity with SSH keys to make a very educated guess on how to proceed, so I am hoping to simply figure out how to get or change the password for his root user. I do not think this is the same as the "root" user credentials I use to sign in to my AWS console. Why does this seem so complicated? When I have had a VPS with other providers in the past, I could usually get a root user password and this migration tool just works. I know this will require him (my colleague) to connect to his server, which I do not have credentials for at this point. He is willing to give me control for the period required to complete the migration, then he will change passwords again. What I am hoping for is a simple method for changing the root user password, and whether this would cause any issues by changing it, as long as he has it. Would this cause any issues between the VPS and the AWS console as far as administration goes? Any help or suggestions would be greatly appreciated. I have been working on this for over a week with no real progress. I am running out of time.
1
answers
0
votes
9
views
AWS-User-1242566
asked a month ago

Python Flask: OpenCV library does not work, produces HTTP code 502 Bad Gateway when trying to compare images

Hello, I'm having trouble with Python OpenCV library, running on AWS Lightsail container instance. Some information: * It is running on python:3.7 Docker image. * Python Flask app * AWS Lightsail container instance * Using following packages: [link](https://pastebin.com/xD5gEqZH) * Uses opencv-contrib-python-headless==4.5.4.60 for OpenCV. * Error image: [link](https://ibb.co/r7Mm2DX) When trying to compare two images, I'm receiving HTTP status code of 502 Bad Gateway, which is very strange. Seems to work perfectly on my Windows machine locally, but on this Linux image it does not work. `from cv2 import cv2 import logging logger = logging.getLogger() def compare_two_images(image_to_compare_file, image_to_compare_against_file): # Image imports # Features logger.warning("image_to_compare_file " + image_to_compare_file) logger.warning("image_to_compare_against_file " + image_to_compare_against_file) sift = cv2.SIFT_create() logger.warning("SIFT created " + str(sift is None)) # QueryImage img1 = cv2.imread(image_to_compare_file, cv2.IMREAD_GRAYSCALE) logger.warning("IMG1 read created " + str(img1 is None)) # Find the key points and descriptors with SIFT kp1, desc1 = sift.detectAndCompute(img1, None) logger.warning("DETECT AND COMPUTE " + str(kp1 is None) + " " + str(desc1 is None)) img2 = cv2.imread(image_to_compare_against_file, cv2.IMREAD_GRAYSCALE) logger.warning("IMG2 read created " + str(img2 is None)) kp2, desc2 = sift.detectAndCompute(img2, None) logger.warning("DETECT AND COMPUTE " + str(kp2 == None) + " " + str(desc2 is None)) # BFMatcher with default params bf = cv2.BFMatcher() matches = bf.knnMatch(desc1, desc2, k=2) # Apply ratio test good = [] for m, n in matches: if m.distance < 0.55 * n.distance: good.append([m])` It crashes on `kp1, desc1 = sift.detectAndCompute(img1, None) ` and produces **502 Bad Gateway**. Then, on some other endpoints I have in my Python Flask app, it produces **503 Service Temporarily Unavailable** for a very times. After that, I can see that images were deleted. Any help is appreciated.
1
answers
0
votes
26
views
AWS-User-4298801
asked a month ago

Python Flask: OpenCV library does not work, produces HTTP code 502 Bad Gateway when trying to compare images

Hello, I'm having trouble with Python OpenCV library, running on AWS Lightsail container instance. Some information: * It is running on python:3.7 Docker image. * Python Flask app * AWS Lightsail container instance * Using following packages: [link](https://pastebin.com/xD5gEqZH) * Uses opencv-contrib-python-headless==4.5.4.60 for OpenCV. * Error image: [link](https://ibb.co/r7Mm2DX) When trying to compare two images, I'm receiving HTTP status code of 502 Bad Gateway, which is very strange. Seems to work perfectly on my Windows machine locally, but on this Linux image it does not work. `from cv2 import cv2 import logging logger = logging.getLogger() def compare_two_images(image_to_compare_file, image_to_compare_against_file): # Image imports # Features logger.warning("image_to_compare_file " + image_to_compare_file) logger.warning("image_to_compare_against_file " + image_to_compare_against_file) sift = cv2.SIFT_create() logger.warning("SIFT created " + str(sift is None)) # QueryImage img1 = cv2.imread(image_to_compare_file, cv2.IMREAD_GRAYSCALE) logger.warning("IMG1 read created " + str(img1 is None)) # Find the key points and descriptors with SIFT kp1, desc1 = sift.detectAndCompute(img1, None) logger.warning("DETECT AND COMPUTE " + str(kp1 is None) + " " + str(desc1 is None)) img2 = cv2.imread(image_to_compare_against_file, cv2.IMREAD_GRAYSCALE) logger.warning("IMG2 read created " + str(img2 is None)) kp2, desc2 = sift.detectAndCompute(img2, None) logger.warning("DETECT AND COMPUTE " + str(kp2 == None) + " " + str(desc2 is None)) # BFMatcher with default params bf = cv2.BFMatcher() matches = bf.knnMatch(desc1, desc2, k=2) # Apply ratio test good = [] for m, n in matches: if m.distance < 0.55 * n.distance: good.append([m])` It crashes on `kp1, desc1 = sift.detectAndCompute(img1, None) ` and produces **502 Bad Gateway**. Then, on some other endpoints I have in my Python Flask app, it produces **503 Service Temporarily Unavailable** for a very times. After that, I can see that images were deleted. Any help is appreciated.
1
answers
0
votes
15
views
AWS-User-4298801
asked a month ago
  • 1
  • 90 / page