400 Bad Request when using solrcloud - python

Can anybody help me i want to create a solrcloud on aws using this code https://github.com/LucidWorks/solr-scale-tk i try to build using cmd [fab demo:demo1,n=1] getting below error I'm getting this while pulling instances after connection to amazon server.
ERROR: boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
Appreciate your help
thanks in advance
root#adminuser-VirtualBox:/opt/febric/solr-scale-tk# fab demo:demo1,n=1
Going to launch 1 new EC2 m3.medium instances using AMI ami-8d52b9e6
Setup Instance store BlockDeviceMapping: /dev/sdb -> ephemeral0
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/fabric/main.py", line 743, in main
*args, **kwargs
File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 427, in execute
results['<local-only>'] = task.run(*args, **new_kwargs)
File "/usr/local/lib/python2.7/dist-packages/fabric/tasks.py", line 174, in run
return self.wrapped(*args, **kwargs)
File "/opt/febric/solr-scale-tk/fabfile.py", line 1701, in demo
ec2hosts = new_ec2_instances(cluster=demoCluster, n=n, instance_type=instance_type)
File "/opt/febric/solr-scale-tk/fabfile.py", line 1163, in new_ec2_instances
placement_group=placement_group)
File "/usr/local/lib/python2.7/dist-packages/boto/ec2/connection.py", line 973, in run_instances
verb='POST')
File "/usr/local/lib/python2.7/dist-packages/boto/connection.py", line 1208, in get_object
raise self.ResponseError(response.status, response.reason, body)
boto.exception.EC2ResponseError: EC2ResponseError: 400 Bad Request
<?xml version="1.0" encoding="UTF-8"?>
<Response><Errors><Error><Code>InvalidParameterValue</Code><Message>Value () for parameter groupId is invalid. The value cannot be empty</Message></Error></Errors><RequestID>ca03b6d4-ce0e-46d3-99e3-ccad4a43c4ff</RequestID></Response>

You need to create a security group at your region with the name exactly called "solr-scale-tk" and has the required ports opened up. Please refer to this blog and follow the instructions in Setup Amazon Account part.

Related

Tweepy Python returns: 401 Unauthorized

So, I was trying to like a Tweet using Tweepy, but this error is occurring:
Traceback (most recent call last):
File "c:/Users/User/Desktop/VScode/Python/FibraBot_home/bottwitter2.py", line 32, in <module>
tweet.favorite()
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\tweepy\models.py", line 371, in favorite
return self._api.create_favorite(self.id)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\tweepy\api.py", line 46, in wrapper
return method(*args, **kwargs)
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\tweepy\api.py", line 913, in create_favorite
), id=id, **kwargs
File "C:\Users\User\AppData\Local\Programs\Python\Python36\lib\site-packages\tweepy\api.py", line 257, in request
raise Unauthorized(resp)
tweepy.errors.Unauthorized: 401 Unauthorized
PS C:\Users\User\Desktop\VScode\Python\FibraBot_home>
Any ideas?
If you’re using a method that performs an action on behalf of the authenticating user, e.g. API.update_status(), make sure your app has the write permission.
After giving it the write permission, make sure to regenerate and use new credentials to utilize it.
https://tweepy.readthedocs.io/en/v4.8.0/faq.html#why-am-i-encountering-a-401-unauthorized-error-with-api-or-403-forbidden-error-with-client

google cloud logging not working while working with python

python code.
import google.cloud.logging
client = google.cloud.logging.Client.from_service_account_json("file.config")
client.setup_logging()
import logging
loggin.info("error")
traceback:
Traceback (most recent call last):
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/api_core/grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/grpc/_channel.py", line 923, in __call__
return _end_unary_response_blocking(state, call, False, None)
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/grpc/_channel.py", line 826, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.PERMISSION_DENIED
details = "The caller does not have permission"
debug_error_string = "{"created":"#1612798593.245379000","description":"Error received from peer ipv4:142.250.71.42:443","file":"src/core/lib/surface/call.cc","file_line":1062,"grpc_message":"The caller does not have permission","grpc_status":7}"
>
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/cloud/logging/handlers/transports/background_thread.py", line 123, in _safely_commit_batch
batch.commit()
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/cloud/logging/logger.py", line 383, in commit
client.logging_api.write_entries(entries, **kwargs)
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/cloud/logging/_gapic.py", line 121, in write_entries
self._gapic_api.write_log_entries(
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/cloud/logging_v2/gapic/logging_service_v2_client.py", line 476, in write_log_entries
return self._inner_api_calls["write_log_entries"](
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/api_core/gapic_v1/method.py", line 145, in __call__
return wrapped_func(*args, **kwargs)
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/api_core/retry.py", line 281, in retry_wrapped_func
return retry_target(
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/api_core/retry.py", line 184, in retry_target
return target()
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/api_core/timeout.py", line 214, in func_with_timeout
return func(*args, **kwargs)
File "/Users/soubhagyapradhan/Desktop/upwork/baby/data-science/env/lib/python3.8/site-packages/google/api_core/grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "<string>", line 3, in raise_from
google.api_core.exceptions.PermissionDenied: 403 The caller does not have permission
Here i am trying to use google logging, But i am getting above error.
Please take a look
I am doing this using python. Is there any issue on generating service account creation
As John said, have you checked if the Service Account has the proper role assigned? As the official documentation says: "Using Cloud Logging library for Python requires the IAM Logs Writer role on Google Cloud. Most Google Cloud environments provide this role by default".
On the other hand, I am bit curious you used the "google-cloud-storage" tag, however you are not mention something related to it. Have you checked if the issue is because you do not have the enough permissions (As Storage Admin) to access your bucket?
I was using :
client = google.cloud.logging.Client()
(not ".from_service_account_json")
and I was getting the exact same error message. I also had the proper role roles/logging.logWriter. I am using using cloud-logging 2.6.0
I found that when I ran the code above in Vertex AI training job, if I don't create a client using my project_id in the following way:
client = google.cloud.logging.Client(project=<user project number>)
then google.cloud.logging use some kind of dummy project_id i.e "i285ca2410679d8f1p-tp" which don't have the necessay access. Putting my project_id and all the error messages are then gone.

Internal Server Error when get the tags of the virtual guest

The API is returning Internal Server Error when I try to get the tags of the virtual guests of a customer account.
Code example using the SoftLayer API library:
api = SoftLayer.Client(username=customer_id, api_key=customer_apikey)
api['Account'].getVirtualGuests(mask='fullyQualifiedDomainName,tagReferences.tag.name')
The exception is:
File "scripts/getting_tags.py", line 16, in <module>
for item in func(mask='fullyQualifiedDomainName,tagReferences.tag.name'):
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/API.py", line 362, in call_handler
return self(name, *args, **kwargs)
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/API.py", line 330, in call
return self.client.call(self.name, name, *args, **kwargs)
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/API.py", line 226, in call
return self.transport(request)
File "/home/mfilipe/workspace/SoftLayerBilling/venv/lib/python2.7/site-packages/SoftLayer/transports.py", line 162, in __call__
raise exceptions.TransportError(ex.response.status_code, str(ex))
SoftLayer.exceptions.TransportError: TransportError(500): 500 Server Error: Internal Server Error
Couple months ago that API call was working properly. When I execute the same call for the hardware (api['Account'].getHardware) or remove tagReferences from mask, it works.
it looks like an error because the reponse contains a big amount of data try to add limits in your request:
api = SoftLayer.Client(username=customer_id, api_key=customer_apikey)
api['Account'].getVirtualGuests(mask='fullyQualifiedDomainName,tagReferences.tag.name',limit=10, offset=0)
for more information about limits see:
http://softlayer-api-python-client.readthedocs.io/en/latest/api/client/
Regards

Python Geocoders Not Working

I am trying to access geolocation of addresses input by the User in my Django App.
The App was working fine with pygeocoder. Suddenly, the app has started giving problems.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pygeocoder.py", line 129, in geocode
return GeocoderResult(Geocoder.get_data(params=params))
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pygeocoder.py", line 204, in get_data
response = session.send(request.prepare())
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/adapters.py", line 370, in send
timeout=timeout
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen
body=body, headers=headers)
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 344, in _make_request
self._raise_timeout(err=e, url=url, timeout_value=conn.timeout)
File "/home/ishaan/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 314, in _raise_timeout
if 'timed out' in str(err) or 'did not complete (read)' in str(err): # Python 2.6
TypeError: __str__ returned non-string (type Error)
I am unable to unserstand this problem, and have a close to no knowledge about SSL and its errors.
I dont know, how relevant it is, but the app was working until I installed Redis Server for another app in the same project. I have uninstalled it, but it is still not working.
Lastly, No other Geocoder is working - Every geocoder gives the same error. I tried to use GeoPy, geocoder 1.6.4
Thanks in advance

trigger.io toolkit dies when uploading private module

I'm getting an error when trying to upload a custom module for a trigger app. I'm not sure what's going on; it looks like maybe a bad response a badly formatted json.
Error in remote call to api.post_files: Forge API call to module/admob/version went wrong: Expecting object: line 9 column 1 (char 174)
Traceback (most recent call last):
File "/Users/kevzettler/Library/Trigger Toolkit/build-tools/forge/async.py", line 106, in run
result = self._target(*self._args, **self._kwargs)
File "/Users/kevzettler/Library/Trigger Toolkit/trigger/api/api.py", line 20, in post_files
return forge_tool.singleton.remote._api_post(method, data=data, cookies=cookies, files=opened_files)
File "/Users/kevzettler/Library/Trigger Toolkit/build-tools/forge/remote.py", line 475, in _api_post
_check_api_response_for_error(url, 'POST', resp)
File "/Users/kevzettler/Library/Trigger Toolkit/build-tools/forge/remote.py", line 121, in _check_api_response_for_error
_raise_if_json_error(content_dict, error_template, resp, url)
File "/Users/kevzettler/Library/Trigger Toolkit/build-tools/forge/remote.py", line 81, in _raise_if_json_error
raise RequestError(resp, error_message, errors=errors)
RequestError: Forge API call to module/admob/version went wrong: Expecting object: line 9 column 1 (char 174)
It looks like the content of your config_schema.json file is invalid.
Unfortunately the error message you see isn't very useful. The good news is newer platform versions have better validation of local files before upload, so if you develop your module against a newer platform version errors like this should be listed in the Toolkit before upload.

Categories