openstack-swift with OVH returns 401 Unauthorized - openstack-swift

I'm using a swift bucket on OVH
The CLI tool swift -A $OS_AUTH_URL -U $OS_USERNAME -K $OS_PASSWORD list -l foto-condivise works smoothly.
My config is:
s3proxy:
image: andrewgaul/s3proxy
ports:
- 127.0.0.1:8084:80
environment:
S3PROXY_AUTHORIZATIONs: none
JCLOUDS_PROVIDER: openstack-swift
JCLOUDS_ENDPOINT: $OS_AUTH_URL
JCLOUDS_REGION: $OS_REGION_NAME
JCLOUDS_REGIONS: $OS_REGION_NAME
#JCLOUDS_IDENTITY: $OS_TENANT_NAME:$OS_USERNAME
JCLOUDS_IDENTITY: $OS_TENANT_ID:OS_USERNAME
JCLOUDS_CREDENTIAL: $OS_PASSWORD
JCLOUDS_KEYSTONE_VERSION: $OS_IDENTITY_API_VERSION
JCLOUDS_KEYSTONE_SCOPE: project:Default
JCLOUDS_KEYSTONE_PROJECT_DOMAIN_NAME: Default
(I've tried both versions of JCLOUDS_IDENTITY) the log states:
s3proxy_1 | [s3proxy] E 05-05 17:50:08.975 main org.gaul.s3proxy.Main:238 |::] Exception in thread "main"
s3proxy_1 | [s3proxy] E 05-05 17:50:08.979 main org.gaul.s3proxy.Main:238 |::] org.jclouds.rest.AuthorizationException: request: POST https://auth.cloud.ovh.net/v3/auth/tokens HTTP/1.1 [Sensitive data in payload, use jclouds.wire.log.sensitive override to enable logging this data.] failed with response: HTTP/1.1 401 Unauthorized
s3proxy_1 | [s3proxy] E 05-05 17:50:08.979 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.openstack.swift.v1.handlers.SwiftErrorHandler.handleError(SwiftErrorHandler.java:51)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.http.handlers.DelegatingErrorHandler.handleError(DelegatingErrorHandler.java:65)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.http.internal.BaseHttpCommandExecutorService.shouldContinue(BaseHttpCommandExecutorService.java:138)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.http.internal.BaseHttpCommandExecutorService.invoke(BaseHttpCommandExecutorService.java:107)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.rest.internal.InvokeHttpMethod.invoke(InvokeHttpMethod.java:91)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:74)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.rest.internal.InvokeHttpMethod.apply(InvokeHttpMethod.java:45)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.rest.internal.DelegatesToInvocationFunction.handle(DelegatesToInvocationFunction.java:156)
s3proxy_1 | [s3proxy] E 05-05 17:50:08.980 main org.gaul.s3proxy.Main:238 |::] at org.jclouds.rest.internal.DelegatesToInvocationFunction.invoke(DelegatesToInvocationFunction.java:123)

Related

VScode Exception occur: System.ArgumentOutOfRangeException

When I try to run any c++ program in vs code an exception occur and do not run the program
Oops, something went wrong. Please report this bug with the details below.
Report on GitHub: https://github.com/lzybkr/PSReadLine/issues/new
-----------------------------------------------------------------------
Last 101 Keys:
c d Space " c : \ U s e r s \ U S E R
\ D o c u m e n t s \ p r o g r a m m i n g \ " Space ; Space i f Space ( $ ?
) Space { Space g + + Space c o d e 2 . c p p Space - o Space c o d e 2 Space
} Space ; Space i f Space ( $ ? ) Space { Space . \ c o d e 2 Space } Enter
Exception:
System.ArgumentOutOfRangeException: The value must be greater than or equal to zero and less than the console's buffer size in that dimension.
Parameter name: left
Actual value was -1.
at System.Console.SetCursorPosition(Int32 left, Int32 top)
at Microsoft.PowerShell.Internal.VirtualTerminal.set_CursorLeft(Int32 value)
at Microsoft.PowerShell.PSConsoleReadLine.ReallyRender(RenderData renderData, String defaultColor)
at Microsoft.PowerShell.PSConsoleReadLine.ForceRender()
at Microsoft.PowerShell.PSConsoleReadLine.Insert(Char c)
at Microsoft.PowerShell.PSConsoleReadLine.SelfInsert(Nullable`1 key, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignoreIfNoAction, Object arg)
at Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
at Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
-----------------------------------------------------------------------
By using manual command in terminal , I can run my c++ program.
I can find some issues in vscode github repository about this problem but can not understand any solution

pytorch forecasting extract feature from hidden layer

I'm following the PyTorch Forecasting tutorial: https://pytorch-forecasting.readthedocs.io/en/latest/tutorials/building.html
I implemented a LSTM using AutoRegressiveBaseModelWithCovariates and to initialized the model from my dataset.
from pytorch_forecasting.models.rnn import RecurrentNetwork
...
model = RecurrentNetwork.from_dataset(dataset_with_covariates)
I've been asked to get the output of a hidden layer and visualize w tSNE or UMAP (something I've done before with Keras). I'm new to PyTorch unfortunately. Does anyone know how to do this?
Here's the summary.
| Name | Type | Params
----------------------------------------------------------------------------------
0 | loss | MAE | 0
1 | logging_metrics | ModuleList | 0
2 | logging_metrics.0 | SMAPE | 0
3 | logging_metrics.1 | MAE | 0
4 | logging_metrics.2 | RMSE | 0
5 | logging_metrics.3 | MAPE | 0
6 | logging_metrics.4 | MASE | 0
7 | embeddings | MultiEmbedding | 47
8 | embeddings.embeddings | ModuleDict | 47
9 | embeddings.embeddings.level_0 | Embedding | 12
10 | embeddings.embeddings.supervisorvehiclestatus | Embedding | 35
11 | rnn | LSTM | 2.5 K
12 | output_projector | Linear | 11
----------------------------------------------------------------------------------
2.5 K Trainable params
0 Non-trainable params
2.5 K Total params
0.010 Total estimated model params size (MB)
In attempt to find the layer name, I did:
for name, layer in model.named_modules():
print(name, layer)
RecurrentNetwork(
(loss): MAE()
(logging_metrics): ModuleList(
(0): SMAPE()
(1): MAE()
(2): RMSE()
(3): MAPE()
(4): MASE()
)
(embeddings): MultiEmbedding(
(embeddings): ModuleDict(
(group_name): Embedding(4, 3)
(categorical_var ): Embedding(7, 5)
)
)
(rnn): LSTM(28, 10, num_layers=2, batch_first=True, dropout=0.1)
(output_projector): Linear(in_features=10, out_features=1, bias=True)
)
loss MAE()
logging_metrics ModuleList(
(0): SMAPE()
(1): MAE()
(2): RMSE()
(3): MAPE()
(4): MASE()
)
logging_metrics.0 SMAPE()
logging_metrics.1 MAE()
logging_metrics.2 RMSE()
logging_metrics.3 MAPE()
logging_metrics.4 MASE()
embeddings MultiEmbedding(
(embeddings): ModuleDict(
(group_name): Embedding(4, 3)
(categorical_var ): Embedding(7, 5)
)
)
embeddings.embeddings ModuleDict(
(group_name): Embedding(4, 3)
(categorical_var ): Embedding(7, 5)
)
embeddings.embeddings.level_0 Embedding(4, 3)
embeddings.embeddings.categorical_var Embedding(7, 5)
rnn LSTM(28, 10, num_layers=2, batch_first=True, dropout=0.1)
output_projector Linear(in_features=10, out_features=1, bias=True)
I thought I could do something like this to get the activations, but it is not working.
def get_hidden_features(x, layer):
activation = {}
def get_activation(name):
def hook(m, i, o):
activation[name] = o.detach()
return hook
model.register_forward_hook(get_activation(layer))
_ = model(x)
return activation[layer]
outhidden = get_hidden_features(x, "rnn")
Returns:
AttributeError: 'Output' object has no attribute 'detach'

Flux/Publisher on main thread

I'm new to reactive programming/project-reactor, trying to understand the concepts. Created a Flux with range method and subscribed. When I look at the log, everything is running on main thread.
Flux
.range(1, 5)
.log()
.subscribe(System.out::println);
System.out.println("End of Execution");
[DEBUG] (main) Using Console logging [ INFO] (main) |
onSubscribe([Synchronous Fuseable] FluxRange.RangeSubscription) [
INFO] (main) | request(unbounded) [ INFO] (main) | onNext(1) 1 [ INFO]
(main) | onNext(2) 2 [ INFO] (main) | onNext(3) 3 [ INFO] (main) |
onNext(4) 4 [ INFO] (main) | onNext(5) 5 [ INFO] (main) | onComplete()
End of Execution
Once Publisher is done with the emission of all elements, then only the rest of the code got executed(System.out.println("End of Execution"); in the above example). Publisher will block the thread by default? If I change the scheduler, seems it's not blocking the thread.
Flux
.range(1, 5)
.log()
.subscribeOn(Schedulers.elastic())
.subscribe(System.out::println);
System.out.println("End of Execution");
Thread.sleep(10000);
[DEBUG] (main) Using Console logging End of Execution [ INFO]
(elastic-2) | onSubscribe([Synchronous Fuseable]
FluxRange.RangeSubscription) [ INFO] (elastic-2) | request(unbounded)
[ INFO] (elastic-2) | onNext(1) 1 [ INFO] (elastic-2) | onNext(2) 2 [
INFO] (elastic-2) | onNext(3) 3 [ INFO] (elastic-2) | onNext(4) 4 [
INFO] (elastic-2) | onNext(5) 5 [ INFO] (elastic-2) | onComplete()
Reactor does not enforce a concurrency model by default and yes, many operators will continue the work on the Thread where the subscribe() operation happened.
But this doesn't mean that using Reactor will block the main thread. The sample you're showing is doing in-memory work, no I/O or latency involved. Also, it's subscribing right away on the result.
You can try the following snippet and see something different:
Flux.range(1, 5)
.delayElements(Duration.ofMillis(100))
.log()
.subscribe(System.out::println);
System.out.println("End of Execution");
In the logs, I'm seeing:
INFO --- [main] reactor.Flux.ConcatMap.1 : onSubscribe(FluxConcatMap.ConcatMapImmediate)
INFO --- [main] reactor.Flux.ConcatMap.1 : request(unbounded)
End of Execution
In this case, delaying elements will schedule work in a different way - and since nothing here is keeping the JVM alive, the application exits and no element from the range is consumed.
In a more common scenario, I/O and latency will be involved and that work will be scheduled in appropriate ways and will not block the main application thread.

Ceph : (synchronizing) e1 ms_verify_authorizer bad authorizer from mon (bad crc in front)

I'm trying to build a 3-monitor Ceph cluster with 5 OSDs using the manual documentation : http://docs.ceph.com/docs/master/install/manual-deployment/#monitor-bootstrapping.
Since I'm using Debian Buster on arm64, there no pre-built package for debian-luminous, but I built my own (apt-get source ceph-mgr;cd ceph-12*;dpkg-buildpackage). The end result is available here : https://github.com/sebt3/packages.
Deploying the 1st monitor works rather fine, but when I'm adding a second monitor (using http://docs.ceph.com/docs/master/rados/operations/add-or-rm-mons/) I encounter a problem. The second monitor doesnt connect. Starting it manually (/usr/bin/ceph-mon -f --cluster ceph --id nano13 --setuser ceph --setgroup ceph -d --debug_ms 5), I'm guetting these errors :
2018-09-04 18:18:41.077937 7f89c86790 0 mon.nano13#-1(synchronizing) e1 ms_verify_authorizer bad authorizer from mon 192.168.10.12:6789/0
2018-09-04 18:18:41.078176 7f89c86790 0 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH pgs=300 cs=73 l=0).handle_connect_msg: challenging authorizer
2018-09-04 18:18:41.082448 7f89c86790 2 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_ACCEPTING_WAIT_SEQ pgs=302 cs=75 l=0).handle_connect_msg accept write reply msg done
2018-09-04 18:18:41.085526 7f89c86790 2 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_ACCEPTING_WAIT_SEQ pgs=302 cs=75 l=0)._process_connection accept get newly_acked_seq 3
2018-09-04 18:18:41.097364 7f89c86790 0 bad crc in front 4144944612 != exp 3525444667
2018-09-04 18:18:41.097557 7f89c86790 1 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_OPEN_MESSAGE_READ_FOOTER_AND_DISPATCH pgs=302 cs=75 l=0).process decode message failed
2018-09-04 18:18:41.102803 7f8ac88790 1 -- 192.168.10.13:6789/0 >> - conn(0x55a4981000 :6789 s=STATE_ACCEPTING pgs=0 cs=0 l=0)._process_connection sd=29 -
2018-09-04 18:18:41.145781 7f8ac88790 0 mon.nano13#-1(synchronizing) e1 ms_verify_authorizer bad authorizer from mon 192.168.10.12:6789/0
2018-09-04 18:18:41.146050 7f8ac88790 0 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4981000 :6789 s=STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH pgs=0 cs=0 l=0).handle_connect_msg: challenging authorizer
2018-09-04 18:18:41.149062 7f8ac88790 0 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4981000 :6789 s=STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH pgs=0 cs=0 l=0).handle_connect_msg accept connect_seq 76 vs existing csq=75 existing_state=STATE_STANDBY
2018-09-04 18:18:41.149336 7f8ac88790 2 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4981000 :6789 s=STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH pgs=0 cs=0 l=0)._stop
2018-09-04 18:18:41.149481 7f8ac88790 1 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4981000 :6789 s=STATE_CLOSED pgs=0 cs=0 l=0).handle_connect_msg stop myself to swap existing
2018-09-04 18:18:41.153284 7f8ac88790 0 mon.nano13#-1(synchronizing) e1 ms_verify_authorizer bad authorizer from mon 192.168.10.12:6789/0
2018-09-04 18:18:41.153537 7f8ac88790 0 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_ACCEPTING_WAIT_CONNECT_MSG_AUTH pgs=302 cs=75 l=0).handle_connect_msg: challenging authorizer
2018-09-04 18:18:41.157265 7f8ac88790 2 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_ACCEPTING_WAIT_SEQ pgs=304 cs=77 l=0).handle_connect_msg accept write reply msg done
2018-09-04 18:18:41.159938 7f8ac88790 2 -- 192.168.10.13:6789/0 >> 192.168.10.12:6789/0 conn(0x55a4947800 :-1 s=STATE_ACCEPTING_WAIT_SEQ pgs=304 cs=77 l=0)._process_connection accept get newly_acked_seq 3
2018-09-04 18:18:41.171493 7f8ac88790 0 bad crc in front 4144944612 != exp 3525444667
Any pointer would be more than welcome :)

getting wget error while trying to upgrade openwrt kernel

BusyBox v1.22.1 (2014-11-14 10:11:32 CST) built-in shell (ash)
Enter 'help' for a list of built-in commands.
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -| || | | || _|| _|
|_______|| __|_____||||________||| |____|
|__| W I R E L E S S F R E E D O M
CHAOS CALMER (Bleeding Edge, unknown)
1 1/2 oz Gin Shake with a glassful
1/4 oz Triple Sec of broken ice and pour
3/4 oz Lime Juice unstrained into a goblet.
1 1/2 oz Orange Juice
1 tsp. Grenadine Syrup
root#OpenWrt:~# wget https://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/m
t7620/openwrt-15.05.1-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin
wget: not an http or ftp url: https://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7620/openwrt-15.05.1-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin
root#OpenWrt:~#
Replace https in your link with http:
wget http://downloads.openwrt.org/chaos_calmer/15.05.1/ramips/mt7620/openwrt-15.05.1-ramips-mt7620-ArcherC20i-squashfs-sysupgrade.bin
Your installed version of wget doesn't support TLS (libopenssl is not installed).
Also, I would change to /tmp dir first, so that downloaded image is stored in RAM (you probably don't have enough space in flash):
cd /tmp
wget http://...