I am using the package m2mtech/weblate-translation-provider to push Symfony translations to a self-hosted Weblate instance.
When calling this command:
bin/console translation:push --domains=messages weblate -vv
I get the following error in the logs:
INFO [http_client] Request: "GET https://WEBLATE_DOMAIN/api/projects/MY_PROJECT/components/"
INFO [http_client] Response: "200 https://WEBLATE_DOMAIN/api/projects/MY_PROJECT/components/"
INFO [http_client] Request: "GET http://WEBLATE_DOMAIN/api/components/MY_PROJECT/messages/translations/"
INFO [http_client] Redirecting: "308 https://WEBLATE_DOMAIN/api/components/MY_PROJECT/messages/translations"
INFO [http_client] Response: "404 https://WEBLATE_DOMAIN/api/components/MY_PROJECT/messages/translations"
In TranslationApi.php line 66:
[Symfony\Component\Translation\Exception\ProviderException]
Unable to get weblate components translations for messages.
Why does the last URL get a 404 response? Did I set up Weblate incorrectly or am using the command line tool wrong?
The second request is using HTTP.
You should replace it by HTTPS to prevent the broken redirect.
The URL is missing the trailing slash - it should be https://WEBLATE_DOMAIN/api/components/MY_PROJECT/messages/translations/
Related
I started to learn Python with connexion and flask and got stuck resolving an issue. Even after taking a long break I cannot see where I am wrong and need some advise.
I created a swagger API definition which maps /api/blacklist/{zipcode} to a function. However when I try to access /api/blacklist/12345 I receive a 404. The YAML is located here:
https://github.com/TheHasgarion/pythonflaskrest/blob/master/api.yml
The mapping for /api/blacklist/ works just fine. BTW, even accessing /api/blacklist/ gives me a 404.
The server log says:
127.0.0.1 - - [23/Jun/2019 19:52:09] "GET /api/blacklist/12345 HTTP/1.1" 404 -
127.0.0.1 - - [23/Jun/2019 19:57:16] "GET /api/blacklist HTTP/1.1" 200 -
127.0.0.1 - - [23/Jun/2019 19:57:18] "GET /api/blacklist/ HTTP/1.1" 404 -
Thank you very much in advance for guidance.
Apparently you need to use integer as type, not number. Whyever 'number' means 'float' :-)
my route is fetching user tokens
GET /tokens
average response time is around 180ms and response is json.
using Flask + nginx.
some requests, the response content is truncated at around 33kb, thus the JSON is malformed. some requests, with the same parameters, at nearly the same time, the response is ok at around 216kb.
My question is, why is this happening and why is this happening in an un consist way?
here is flask response code
class NormalResponse(Response):
def __init__(self, response):
super(NormalResponse, self).__init__(response, 200)
res = json.dumps(paginator.paginate(tokens))
return NormalResponse(res)
I found the issue related to nginx since the failed responses have this logs
2018/12/18 16:35:17 [crit] 16#16: *95010 open() "/var/tmp/nginx/uwsgi/1/42/0000000421" failed (13: Permission denied) while reading upstream, client: 172.31.72.76, server: , request: "GET /tokens?limit=501&offset=0&order=desc&owner_id=11111 HTTP/1.1", upstream: "uwsgi://unix:/run/server.socket:", host: "oauth.dev.bla_bla.com"
Seems like response overflows proxy_buffers and tries to temporarily save it to proxy_temp_path and your error message quite confirms it. You should check file permissions of nginx's user on that folder.
This problem has been resolved by adding
RUN chown -R www-data:www-data /var/tmp/nginx
to the Dockerfile
I am using robotframework and I would like know what can I do so that I can avoid going through the proxy? I am using Windows and I have made sure there are no proxy variables in environment variables. I am also connected via WI-FI unlike others who are on LAN for who do not see issue with the GET request.
KEYWORD ${resp} = RequestsLibrary . Get Request session, /token, params=${user info}, headers=${HEADER}
Documentation:
Send a GET request on the session object found using the
Start / End / Elapsed: 20180102 13:17:11.558 / 20180102 13:18:26.569 / 00:01:15.011
13:17:11.566 DEBUG Starting new HTTP connection (1): proxy-sanfran
13:17:11.577 DEBUG http://proxy-sanfran:80 "GET http://localhost:9000/token?userName=test_user&password=test123 HTTP/1.1" 301 None
13:17:11.586 DEBUG Resetting dropped connection: proxy-sanfran
13:18:26.566 DEBUG http://proxy-sanfran:80 "GET http://10.138.37.40 HTTP/1.1" 503 787
13:18:26.568 INFO Get Request using : alias=session, uri=/token, headers={'Content-Type': 'application/json'} json=None
13:18:26.568 INFO ${resp} = <Response [503]>
try with setting environment variable
NO_PROXY = "localhost"
I've just started working with the Quectel MC60 and I am having some issues:
About HTTP GET method, I make the following commands:
AT+QIFGCNT=0
AT+QICSGP=1,"my_apn"
AT+QIREGAPP
AT+QIACT
AT+QSSLCFG="https",1
AT+QHTTPURL=39,40
my_url_39_bytes_long
AT+QHTTPGET=60
AT+QHTTPREAD=30
AT+QIDEACT
When using the QCOM software, I make a script running all the above commands sequentially. When it comes to the AT+QHTTPREAD command, the response is always "+CME ERROR: 3822" (HTTP response failed). What can it be? I'm sure the HTTP server is working properly.
The answer is that it is necessary to configure the request header
AT+QIFGCNT=0
AT+QICSGP=1,"my_apn"
AT+QIREGAPP
AT+QIACT
AT+QHTTPURL=39,40
my_url_39_bytes_long
AT+QHTTPCFG="requestheader",1
AT+QHTTPPOST=77
GET path HTTP/1.1
User-Agent: Fiddler
Host: www.my_host.com
AT+QHTTPREAD=30
AT+QIDEACT
NOTE: in AT+HTTPPOST=77, 77 is the size of the POST message (last two \r\n are required and count)
NOTE2: after GET you're supposed to write the path to the url inserted in AT+QHTTPURL. For example, if you specified your URL as https://www.my_host.com/debug/main/port, your AT+HTTPPOST request should look like this (don't forget the last two \r\n):
GET /debug/main/port HTTP/1.1
User-Agent: Fiddler
Host: www.my_host.com
I'm having, in a PHP form, when I'm submiting one email as a suscriber in a Wordpress theme, the next error in error.log:
2013/08/03 21:39:22 [error] 19544#0: *11 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(TEMPLATEPATH/functions/theme-functions.php): failed to open stream: No such file or directory in /web/domain.com/public/wp-content/themes/launcheffect/functions.php on line 151
PHP message: PHP Fatal error: require_once(): Failed opening required 'TEMPLATEPATH/functions/theme-functions.php' (include_path='.:/usr/share/php:/usr/share/pear') in /web/domain.com/public/wp-content/themes/launcheffect/functions.php on line 151" while reading response header from upstream, client: 71.28.74.212, server: www.domain.com, request: "POST /wp-content/themes/launcheffect/post.php HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "www.domain.com", referrer: "http://www.domain.com/"
I've been reading about permissions, about nginx and fastcgi, about PHPfpm, reviewing my config...without success. More, I've other sites working perfectly, and that theme worked well some days ago.
Of course I've that file/directory.
My nginx.conf:
http://pastebin.com/5VB1BzHj
Can anyone help me to solve this error?
Thanks in advance!
Looking at your example error it appears you are not formatting the require correctly. It should look something like this:
require_once(TEMPLATEPATH . '/functions/theme-functions.php');
Make certain that you are also defining your TEMPLATEPATH.
define("TEMPLATEPATH ", "/this/is/your/path");
In the end, this should output a string:
/this/is/your/path/functions/theme-functions.php
For anyone having this problem, double check your file paths and file names as mine was caused by a case sensitive file path where I had missed an Uppercase letter