These are chat archives for mirumee/saleor

23rd
Aug 2018
Николай Инкогнито
@mmmsvit_gitlab
Aug 23 2018 10:41 UTC
Hi, who use notification for saleor (email, sms...), what package you use? Or core team have any plans to introduce notification?
i start use: https://github.com/v1k45/django-notify-x, but just now find more powerfull https://github.com/danidee10/django-notifs (real need notify user with email + sms + inside app)
Николай Инкогнито
@mmmsvit_gitlab
Aug 23 2018 11:15 UTC
i'm on in ignore zone?)
Mateusz Barlikowski
@Kappa7
Aug 23 2018 11:16 UTC
No, you are not.
Patryk Zawadzki
@patrys
Aug 23 2018 11:19 UTC
@mmmsvit_gitlab I’m unable to help as you are doing something we have no need of doing, we’re not using django-notify-x, I was not even aware of its existence
Николай Инкогнито
@mmmsvit_gitlab
Aug 23 2018 11:33 UTC
th, i see
Kuntal
@Kuntal-KK
Aug 23 2018 11:58 UTC
I have deployed Saleor on heroku and integrated Razorpay payment. But after successful transaction, the page is getting redirected to localhost. I have created the issue here NyanKiyoshi/django-payments-razorpay#2. Please check once @NyanKiyoshi
Stephen Moloney
@stephenmoloney
Aug 23 2018 11:59 UTC
I'm trying to run http requests from shell inside the docker container to an external resource (I'm debugging) but curl is not installed. Is there any python command line tool I can use instead, any suggestions ?
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 11:59 UTC
@Kuntal-KK did you configure the domain in saleor settings?
In dashboard > site settings
Stephen Moloney
@stephenmoloney
Aug 23 2018 12:03 UTC
I've come up with an alternative solution, nvm. I'll start a temporary docker container for what im doing inside the cluster.
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 12:04 UTC
@stephenmoloney requests is simple to use, it's probably even already installed from a dependency (maybe).
import request

resp = request.get('http://example.com')
resp.status_code
resp.headers
resp.content

resp = request.post('url', data={'val': 'abc'})
Alright
Stephen Moloney
@stephenmoloney
Aug 23 2018 12:04 UTC
But i need to write a python module then...
kinda wanna stick to the shell, it's a simple request...
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 12:05 UTC
You cannot run directly into a python shell?
Stephen Moloney
@stephenmoloney
Aug 23 2018 12:06 UTC
ah, yea, actually, I'll do the same with the SECRET_KEY you suggested if i can fit it on one line.
python3 -c 'import request
resp = request.get("http://saleor-elasticsearch-client:9200")'
unfortunately, not sure request is available
saleor@saleor-5cfd8cdc4f-fncd8:/app$ python3 -c 'import request
> resp = request.get("http://saleor-elasticsearch-client:9200")'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'request'
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 12:12 UTC
My fault: it's requests :thumbsup:
Stephen Moloney
@stephenmoloney
Aug 23 2018 12:15 UTC
@NyanKiyoshi , is there a verbose option to get headers, etc?, nothing is returned
python3 -c 'import requests
requests.get("http://saleor-elasticsearch-client:9200")'
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 12:17 UTC
python3 -c 'import requests
r = requests.get("http://saleor-elasticsearch-client:9200")
print(r.headers)'
Stephen Moloney
@stephenmoloney
Aug 23 2018 12:19 UTC
python3 -c 'import requests
r = requests.get("http://saleor-elasticsearch-client:9200")
print(r.headers)
print(r.content)'
perfect, seems like the connection is fine.
thanks.
Kuntal
@Kuntal-KK
Aug 23 2018 12:39 UTC
@NyanKiyoshi yes I have changed and now it is fine. Thanks.
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:22 UTC
I'm seeing timeouts when running the populatedb command in the cluster.
I can run a GET request and the connection is successful.
Patryk Zawadzki
@patrys
Aug 23 2018 16:23 UTC
it seems you’re using Elasticsearch and it fails
hard to tell why though
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:24 UTC
Happens a good few seconds after running python3 manage.py populatedb --createsuperuser
if I run
Patryk Zawadzki
@patrys
Aug 23 2018 16:24 UTC
the top of the screenshot suggests that there was another exception
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:24 UTC
python3 -c 'import requests
r = requests.get("http://saleor-elasticsearch-client.saleor:9200")
print(r.headers)
print(r.content)'
There is no timeout
and returns:
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 16:25 UTC
The host is different though, typo or?
Patryk Zawadzki
@patrys
Aug 23 2018 16:25 UTC
I think saleor is the docker network so it’s the same host
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:25 UTC
http://saleor-elasticsearch-client:9200 and http://saleor-elasticsearch-client.saleor:9200 both works
NyanKiyoshi
@NyanKiyoshi
Aug 23 2018 16:25 UTC
Alright
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:25 UTC
this is proper though: saleor-elasticsearch-client.saleor
it means host:namespace
in kubernetes is short for
host.namespace.svc.cluster.local
Patryk Zawadzki
@patrys
Aug 23 2018 16:28 UTC
@stephenmoloney can you show us the first exception in the chain ("During handling of the above exception, another exception occurred”)
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:28 UTC
entire output here:
I would create a snippet if i knew how
Patryk Zawadzki
@patrys
Aug 23 2018 16:29 UTC
looks like it was initially connected but then got disconnected in the middle of a read operation
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:29 UTC
is this put through celery? because i haven't started a celery worker yet
Patryk Zawadzki
@patrys
Aug 23 2018 16:30 UTC
no, unless you specify a broker URL celery is not used at all
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:31 UTC
so maybe if i dig into elasticsearch logs...
Read timed out. (read timeout=%s)" is as close a clue as i can get
Patryk Zawadzki
@patrys
Aug 23 2018 16:31 UTC
yeah, it looks like the cluster was maybe restarting
it aborted a read and then disappeared and has since reappeared (hence why HTTP works)
maybe it’s misconfigured and crashes during index updates
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:32 UTC
ah,,
I have a bunch of errors in the elasticsearch logs
Patryk Zawadzki
@patrys
Aug 23 2018 16:32 UTC
these will happen during populatedb as the search server is fed with newly created items
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:32 UTC
this is an init operation before starting to use the web app
Patryk Zawadzki
@patrys
Aug 23 2018 16:33 UTC
populatedb is where example products and orders are created
they are sent to the search cluster so that search works
are you sure you need elasticsearch though?
I’ve worked on many stores that happily work with PostgreSQL as the search engine
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:34 UTC
@patrys I'm creating the helm chart - so i'd be pretty keen to have it working
Patryk Zawadzki
@patrys
Aug 23 2018 16:34 UTC
I’ve noticed that this is from elasticsearch 6.x
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:34 UTC
I want the helm chart to be fully configurable.
Yes elasticsearch 6.
Patryk Zawadzki
@patrys
Aug 23 2018 16:35 UTC
I think docker-compose explicitly uses elasticsearch 5 as they are not compatible
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:35 UTC
what is the issue ?
with 6.x ?
Patryk Zawadzki
@patrys
Aug 23 2018 16:35 UTC
code written for 5.x may not work on 6.x
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:35 UTC
reason is the elasticsearch helm chart underwent some changes from 5.x to 6.x so my life would be easier if worked on 6.x
suppose i can try 5.x to see if it works at least.
Patryk Zawadzki
@patrys
Aug 23 2018 16:36 UTC
I’m aware of any specific changes that make it incompatible with Saleor but I remember having that discussion internally
it may just work or there may be query syntax changes, I’d have to review the upgrading guide
sorry but I need to leave the office
Stephen Moloney
@stephenmoloney
Aug 23 2018 16:37 UTC
no worries, have a good evening, thanks for your help. In any case, I think this may be a problem with the elasticsearch cluster. it is still in incubator status.
i'll work on this a bit more and post back if i get it solved.