-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inaccessible host: localhost'. This service may not be available in the
us-east-1' region.
#125
Comments
Thanks for reporting @ravithejappl . Yes, you should be able to use the |
I am using macos catalina(10.15.5), docker engine 20.10.0, I am getting below error |
i am also getting same error i am using nodejs,docker latest,and localstock latest version |
Same issue here:
|
Same here. I'm using |
Same issue here when trying to send messages to an SQS queue. |
if using docker check out this link |
Same here, started
localstack says it's listen on 4566
How is this supposed to work? |
Fixed by running docker to start localstack instead of |
I am getting the same issue when I try to invoke SQS queue from a lambda function. I tried the same step which @edbond mentioned above, but that didn't seems to be working. local stack version: 0.14.1.3 In my lambda: Actually s3 is working by using below, but not sqs. Note: I am able to send sqs message from aws cli, but not from local stack lambda function. |
This error still happening. |
I found that this error happen with |
I'm using $ sls --version
Framework Core: 3.26.0
Plugin: 6.2.2
SDK: 4.3.2 |
The default serverless host is using In your serverless config, override the host with |
I'm still experiencing the same issue using Serverless 3
With @homeyer solution I got:
|
I was able to circumvent it with |
@aron-airgraft tried it also and got the following error
|
Great catch, thanks for sharing the fix/workaround @homeyer ! Can you confirm if this entry in the config resolves the issue for you @ze-ahmed @aron-airgraft @omerls-pw @fisher-he @elangoram1998 @edbond @ravithejappl @amouly ?
We'll look into getting this fix into the plugin itself, to make the switch between IPv4/IPv6 endpoints automatically. 👍 |
Thanks a lot for your help. |
Gets most of the way there but I ran into |
Thanks for confirming @ze-ahmed @aron-airgraft . We have now pushed a few enhancements in version |
@whummer thanks a lot, it works well for me I've removed the host property in serverless.yml and also the HOSTNAME=127.0.0.1 from the localstack env file |
@whummer the problem still requires workarounds for newer Nodejs versions because v17 changed a default behavior such that IPv6 is favored over IPv4. This breaks the defaults for LocalStack running on IPv4. Workarounds:
|
Thanks for the update @joe4dev . 👍 Do you think we could somehow extend the check in getConnectHostname to also transparently resolve the issues with Node.js v17? |
@whummer yes, I fixed the Javascript bug in getConnectHostname and created PRs for: |
This error exists in Macbook M2 sillicon ship machines |
@Kalanamith We just (2023-02-15T19:17:18.227Z) released serverless-localstack 1.0.4, which implements an IPv4 fallback to fix IPv6-related issues on macOS. Can you please check with the latest version? |
Updating localstack package version to latest to fix issues around host (see localstack/serverless-localstack#125)
I'm also experiencing this problem on an M1 Max, and I'm using My {
"devDependencies": {
"serverless": "^3.27.0",
"serverless-localstack": "^1.0.4"
},
"resolutions": {
"**/aws-sdk": "2.1313.0"
}
}
service: bref-test
provider:
name: aws
region: us-east-1
runtime: provided.al2
layers:
- ${bref:layer.php-82}
deploymentMethod: direct
plugins:
- ./vendor/bref/bref
- serverless-localstack
custom:
localstack:
stages:
- local
host: http://127.0.0.1
debug: true
functions:
hello:
handler: index.php I'm attempting to deploy with the following command: AWS_PROFILE=localstack yarn serverless deploy --stage local And this is the output I see:
|
After fiddling around with this some more, I tried @edbond's tip and started localstack directly from docker run --rm -it -p 4566:4566 localstack/localstack Now, when I run the following, it appears to start: AWS_PROFILE=localstack yarn serverless deploy --stage local
However, when I try to invoke it with: AWS_PROFILE=localstack yarn serverless invoke --stage local --function hello I get another error:
|
I did a bit more fiddling around and I think I'm at the point where it's working properly now. 😄 I found that I need to set HOSTNAME_EXTERNAL=127.0.0.1 localstack start -d Now, when I deploy to localstack, it deploys properly: AWS_PROFILE=localstack yarn serverless deploy --stage local
And when I invoke the function, it at least appears to be properly calling Lambda and getting a valid response, even if it is an error:
I think this is because it can't load the PHP layers from Bref. So, now I think I've come to a limitation of the tool. If I'm using anything that uses layers (e.g. https://bref.sh), are those only supported in Localstack Pro? |
Hi @ramsey Thank you for sharing your experience with LocalStack and PHP/Bref.
Shared layers and mounting Lambda layers are a LocalStack Pro feature (see Lambda Layers). PHP/Bref SampleWe are happy to share our new lambda-php-bref-cdk-app pro-sample (PR#207) supporting both typed PHP Lambda handlers and traditional php-fpm applications (e.g., Laravel). Please pull the latest docker image Other Issues
|
image: localstack/localstack:0.13 works for me |
In combination with serverless-localstack 1.0.4? We recommend updating to the latest version of LocalStack because v0.13 is quite outdated and not supported anymore. |
@joe4dev the latest version does not work it gives the error Port 4566 not accessible |
Hi @Kalanamith
|
This issue occurred on macOS with Nodejs >= v17 but is now fixed #210 and also works with AWS variables after fixing the timing of 👉👉👉 Upgrade to For older versions, manually forcing IPv4 works as confirmed by @omerls-pw
Closing this issue as resolved. Please let us know if the problem persists. |
still happening on github actions localstack-pro |
Can you please create a separate issue and provide some more details:
That would help a lot to reproduce the issue 🙏 |
I was using not serverless-localstack but just docker + localstack, but had same issue Changed 'localhost' to '127.0.0.1' and it works fine. But thing is, on another mac everything was fine |
@Dmtreaqq Were you using Node.js v17 or later? |
@joe4dev both machines Node.js 20 and both Macs but different models. Fun fact. Something happened with my network settings today that I couldn't go into internet (any WIFI hotspot) anymore. Maybe it's totally unrelated, but I needed to delete a list of files from SystemConfiguration. And NOW I changed back to localhost:4566 and it is working. Path: /Library/Preferences/SystemConfiguration/ Context: exernal Node.js backend app connects (send commands) to DynamoDB inside localstack with docker. |
Can't I run this repo without aws account?
The text was updated successfully, but these errors were encountered: