Error 404 -while trying to access read-all function of todo backend app
See original GitHub issueI have deployed todo-app/backend/ app in GKE. while trying to access I am getting error 404.
To me it looks like an issue with ingress setup. I can see two ingress entries when I run below command:
kubectl get ingress
NAME HOSTS ADDRESS PORTS AGE
basic-ingress * 35.190.11.9 80 12d
todos 35.185.19.186.xip.io 80 16h
and the configuration todo yml file is:
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
kubernetes.io/ingress.class: nginx
nginx.ingress.kubernetes.io/rewrite-target: /
creationTimestamp: 2018-04-24T11:43:58Z
generation: 3
name: todos
namespace: default
resourceVersion: "2514019"
selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/todos
uid: c63bd143-47b4-11e8-8366-42010a8e0105
spec:
rules:
- host: 35.185.19.186.xip.io
http:
paths:
- backend:
serviceName: create
servicePort: 8080
path: /create
- backend:
serviceName: read-all
servicePort: 8080
path: /read-all
- backend:
serviceName: read-one
servicePort: 8080
path: /read
- backend:
serviceName: update
servicePort: 8080
path: /update
- backend:
serviceName: delete
servicePort: 8080
path: /delete
status:
loadBalancer: {}
Configuration of basic-ingress is :
# Please edit the object below. Lines beginning with a '#' will be ignored,
# and an empty file will abort the edit. If an error occurs while saving this file will be
# reopened with the relevant failures.
#
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
annotations:
ingress.kubernetes.io/backends: '{"k8s-be-31459--852d88a6b447d59d":"HEALTHY"}'
ingress.kubernetes.io/forwarding-rule: k8s-fw-default-basic-ingress--852d88a6b447d59d
ingress.kubernetes.io/target-proxy: k8s-tp-default-basic-ingress--852d88a6b447d59d
ingress.kubernetes.io/url-map: k8s-um-default-basic-ingress--852d88a6b447d59d
kubectl.kubernetes.io/last-applied-configuration: |
{"apiVersion":"extensions/v1beta1","kind":"Ingress","metadata":{"annotations":{},"name":"basic-ingress","namespace":"default"},"spec":{"backend":{"serviceName":"todos","servicePort":80}}}
creationTimestamp: 2018-04-12T10:58:38Z
generation: 3
name: basic-ingress
namespace: default
resourceVersion: "2512980"
selfLink: /apis/extensions/v1beta1/namespaces/default/ingresses/basic-ingress
uid: 748163de-3e40-11e8-8366-42010a8e0105
spec:
backend:
serviceName: todos
servicePort: 80
status:
loadBalancer:
ingress:
- ip: 35.190.11.9
I am not very sure of this configuration of ingress, can someone help pls?
All my todos functions been deployed successfully:
D:\serverless\serverless-kubeless\examples\todo-app\backend>kubectl get services
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
create ClusterIP 10.15.241.200 <none> 8080/TCP 2h
delete ClusterIP 10.15.254.8 <none> 8080/TCP 2h
hello ClusterIP 10.15.245.239 <none> 8080/TCP 18d
kubernetes ClusterIP 10.15.240.1 <none> 443/TCP 21d
mongodb NodePort 10.15.245.199 <none> 27017:30505/TCP 2h
read-all ClusterIP 10.15.243.242 <none> 8080/TCP 2h
read-one ClusterIP 10.15.248.185 <none> 8080/TCP 2h
update ClusterIP 10.15.253.150 <none> 8080/TCP 2h
Issue Analytics
- State:
- Created 5 years ago
- Comments:11
Top Results From Across the Web
404 Page Not Found Error: What It Is and How to Fix It - Lifewire
A 404 error is an HTTP status code that means that the page you were trying to reach on a website couldn't be...
Read more >How can I fix this error with my API (404 not found)
404 means the path you're requesting wasn't found. See en.wikipedia.org/wiki/HTTP_404 - so /api/code/codes (As shown in the error message) isn' ...
Read more >REST API Error Handling in Go: Behavioral Type Assertion
Use HTTP response status codes to indicate something went wrong (400 Bad Request, 404 Not Found…). Although there are different status codes ...
Read more >Building A Simple CRUD Application With FastAPI
Our endpoint for deleting a todo list item should use an HTTP ... However, if you want to create a new database record...
Read more >Build Your First App with Deno - Fusebit
js, it's time to build a to-do application. The application will consist of a backend API and a frontend user interface, and the...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems to be working, looks like proxy was the issue. I am getting response for read-all like below: [{“_id”:“5ae00d316d04cf1fa3725c02”,“id”:“a09c2b60-4846-11e8-a0b7-a7edc07a3c98”,“updatedAt”:1524632881430},{“_id”:“5aea8b6f6d04cfd863725c03”,“id”:“c0adb080-4e87-11e8-a0b7-a7edc07a3c98”,“updatedAt”:1525320559496},{“_id”:“5aea8bab6d04cf326d725c04”,“id”:“e4343ba0-4e87-11e8-a0b7-a7edc07a3c98”,“updatedAt”:1525320619098},{“_id”:“5aea8bd76d04cf68cc725c05”,“id”:“feaafb90-4e87-11e8-a0b7-a7edc07a3c98”,“updatedAt”:1525320663497},{“_id”:“5aeaa39c6d04cf368b725c06”,“desc”:“Create first todo”,“id”:“29be2bf0-4e96-11e8-a0b7-a7edc07a3c98”,“updatedAt”:1525326748719}]
Had created one entry using postman - {“desc”:“Create first todo”}
I could see that in read-all. Hope this is the expected behavior.
Thanks for your support.
On Wed, May 2, 2018 at 8:31 PM Andres notifications@github.com wrote:
Yes, as far as the IP it assign you is public you should be able to reach it.
That may be cause by an error in the function or a misconfiguration. What does
curl -v <your ip>.nip.io
returns? Did you modify the host of the Ingress object?AFAIK you don’t need to but I recommend you to do so.